Critical bug on stopwatch library at lpcopen_2_10_lpcxpresso_ea_devkit_1788.zip

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Critical bug on stopwatch library at lpcopen_2_10_lpcxpresso_ea_devkit_1788.zip

314 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by C6H6 on Thu Apr 14 11:32:27 MST 2016
I found a critical bug on stopwatch library.

At StopWatch_Init function, it calculates ticks per seconds by this:


ticksPerSecond = Chip_Clock_GetSystemClockRate() / prescaleDivisor / 4 ;


but this is wrong method when SystemClock is 120MHz, and Pheripheral Clock setting at 60Mhz (PCKDIV has been set at 2, by default startup code).

This code has wrong method to calculate ticks. So, I was replace code like this, and operating normaly.

ticksPerSecond = Chip_Clock_GetPeripheralClockRate() / prescaleDivisor ;



Please fix this problem for new beginners get right library.
Labels (1)
0 Kudos
1 Reply

293 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos