15 when the RTOS kernel is in a critical section, but cannot make any calls to 16 FreeRTOS API functions. If configASSERT() is defined in FreeRTOSConfig.h 17 then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion 18 failure if a FreeRTOS API function is called from ...
这里尤其注意第2个if语句,如果创建的新任务优先级更高,那么就立即执行它: #define portYIELD() __asm ( "SWI 0" ) #ifndef portYIELD_WITHIN_API#define portYIELD_WITHIN_API portYIELD #endif #if ( configUSE_PREEMPTION == 0 ) /* If the cooperative scheduler is being used then a yield should not...