MCU:? CH32X035C8
MRS 版本: v1.92
void SysTick_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
void SysTick_Handler(void)
{
? ? runMilis++;
? ? SysTick->SR = 0;
}
//-------------------------------------------------------------------------------------//
// Get System tick counter
//-------------------------------------------------------------------------------------//
uint32_t get_time_tick(void)
{
? ? return runMilis;
}
//--------------------------------------------------------------------------//
// Delay function
//--------------------------------------------------------------------------//
void DelayMS( uint32_t nMS )
{
? ? volatile uint32_t now = get_time_tick();
? ? while( (get_time_tick() - now) < nMS );
}
仿真時(shí) nMS = 500,? 變量 now = 1,? runMilis = 5389, 按理已經(jīng)應(yīng)該return了,但實(shí)際上程序還卡在while里出不來。
請問原廠的FAE,這個(gè)函數(shù)有什么問題嗎?為何一直卡???是不是編譯器有啥BUG?