上面的话不严谨,我往下又查了一下
cubemx里的例程用的是cmsis_os1, 我用的是cmsis_os2,获取SysTick计数的函数变掉了,原来的cmsis_os1是
/**
* @brief Get the value of the Kernel SysTick timer
* @param None
* @retval None
* @note MUST REMAIN UNCHANGED: \b osKernelSysTick shall be consistent in every CMSIS-RTOS.
*/
uint32_t osKernelSysTick(void)
{
if (inHandlerMode()) {
return xTaskGetTickCountFromISR();
}
else {
return xTaskGetTickCount();
}
}