SysCtlDelay(SysCtlClockGet() / 3);这个语句是延时1s
可是在定时器中断时,TimerLoadSet( SysCtlClockGet() ); 这个语句是定时1s
感觉这两个有些矛盾啊?
还是说上面有一个是错的?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
SysCtlDelay(SysCtlClockGet() / 3);这个语句是延时1s
可是在定时器中断时,TimerLoadSet( SysCtlClockGet() ); 这个语句是定时1s
感觉这两个有些矛盾啊?
还是说上面有一个是错的?
两个都是对的。
SysCtlDelay执行一次需要3个时钟周期,因此上述是1s。
定时器默认的时钟和系统时钟一样的。所以这样复制定时器的计数器,中断的间隔是1s。