Critical bug on stopwatch library at lpcopen_2_10_lpcxpresso_ea_devkit_1788.zip

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Critical bug on stopwatch library at lpcopen_2_10_lpcxpresso_ea_devkit_1788.zip

438 次查看
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.
标签 (1)
0 项奖励
回复
1 回复

417 次查看
lpcware
NXP Employee
NXP Employee
bump
0 项奖励
回复