timer.c中的TIMER_reload()函数中写:
// clear the bits
timer->TCR &= (~(uint32_t)TIMER_TCR_TRB_BITS);
TRB:
CPU-Timer Reload bit.
0 The TRB bit is always read as zero. Writes of 0 are ignored.
1 When you write a 1 to TRB, the TIMH:TIM is loaded with the value in the PRDH:PRD,
and the prescaler counter (PSCH:PSC) is loaded with the value in the timer dividedown
register (TDDRH:TDDR).
置一才reload,所以例程函数写错了。
Eric Ma:
Junjie,
感谢你的发现,已将发现的bug提交上去,下一版本的例程会修改这个问题。
正确的代码为:
timer->TCR |= TIMER_TCR_TRB_BITS;
-Eric
TI中文支持网




