void OSIntExit (void) { #if OS_CRITICAL_METHOD == 3 OS_CPU_SR cpu_sr; #endif if (OSRunning == TRUE) { OS_ENTER_CRITICAL(); if (OSIntNesting > 0) { OSIntNesting--; } if ((OSIntNesting == 0) && (OSLockNesting == 0)) { OSIntExitY = OSUnMapTbl[OSRdyGrp]; OSPrioHighRdy = (INT8U)((OSIntExitY << 3) + OSUnMapTbl[OSRdyTbl][OSIntExitY]]); if (OSPrioHighRdy != OSPrioCur) { OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy]; OSCtxSwCtr++; OSIntCtxSw(); } } OS_EXIT_CRITICAL(); } } 上面程序中的OSIntCtxSw();相当于执行return; 因为includes.h中有宏定义 #define OSIntCtxSw() return 执行这个return除了程序返回之外,还有其他什么作用?? |