在移植到 RT-Thread 的過(guò)程中,根據(jù)參考例程,在 SysTick_Handler 中斷處理函數(shù)中會(huì)清零 CNTL 寄存器的值.
```
????? rt_interrupt_enter();
#if 1
????? SysTick->CNTL0 = 0;
????? SysTick->CNTL1 = 0;
????? SysTick->CNTL2 = 0;
????? SysTick->CNTL3 = 0;
????? SysTick->CNTH0 = 0;
????? SysTick->CNTH1 = 0;
????? SysTick->CNTH2 = 0;
????? SysTick->CNTH3 = 0;
????? rt_tick_increase();
#endif
????? NVIC_ClearPendingIRQ(SysTicK_IRQn);
????? rt_interrupt_leave()
```
使用 gdb 調(diào)試,在 SysTick_Handler 函數(shù)打斷點(diǎn):
x /1xw 0xe000f004 發(fā)現(xiàn) CNTL 的數(shù)值并沒(méi)有被清空,具體調(diào)試過(guò)程為:
請(qǐng)問(wèn)是什么原因呢?