-
航顺单片机程序总是死
程序死在了自带库的微秒延时voidBSP_SYSTEM_Delay_us(uint32_tusCnt){/*SysTickdefaultclocksource:HCLK/8=32MHz/8=4MHz*/SysTick->LOAD=4*usCnt;/*ClearSysTickcurrentcountervalue*/SysTick->VAL=0;/*EnableSysTickcounter*/SysTick->CTRL=SysTick_CTRL_ENABLE_Msk;/*WaitforSysTickcounterto0*/while(!(SysTick->CTRL&SysTick_CTRL_COUNTFLAG_Msk))//死在这一部{}/*DisableSysTickcounter*/SysTick->CTRL=~SysTick_CTRL_ENABLE_Msk;/*ClearSysTickcurrentcountervalue*/SysTick->VAL=0;}
2021-09-08 4