StopWatch_Start on LPC15xx returns uint32_t?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

StopWatch_Start on LPC15xx returns uint32_t?

579件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by 1234567890 on Mon Nov 03 14:10:01 MST 2014
Hi,

nice to see a delay function in LPCOpen. But after tracing back StopWatch_DelayUS() there is something I don't understand: StopWatch_Start() reads the current RIT counter value via Chip_RIT_GetCounter(), which correctly returns a uint64_t (because RIT has 48 bits).
But in StopWatch_Start() this value is casted 'down' to uint32_t.
Doesn't this lead to wrong delays when the counter value of RIT is > uint32_t?

Edit:
Ok, so just the lower 32 bits are used which limits the maximum delay time. Bits roll over from right to left. But then it's not neccessary to read the upper part of RIT.
ラベル(1)
0 件の賞賛
返信
0 返答(返信)