高级会员
- 积分
- 691
- 金钱
- 691
- 注册时间
- 2014-9-7
- 在线时间
- 121 小时
|
楼主 |
发表于 2017-6-15 09:58:43
|
显示全部楼层
void SysTick_Handler(void)
{
OSIntEnter(); //½øèëÖD¶Ï
OSTimeTick(); //μ÷óÃucosμÄê±Öó·tÎñ3ìDò
OSIntExit(); //′¥·¢èÎÎñÇD»»èíÖD¶Ï
}
void OSIntExit (void)
{
#if OS_CRITICAL_METHOD == 3u /* Allocate storage for CPU status register */
OS_CPU_SR cpu_sr = 0u;
#endif
if (OSRunning == OS_TRUE) {
OS_ENTER_CRITICAL();
if (OSIntNesting > 0u) { /* Prevent OSIntNesting from wrapping */
OSIntNesting--;
}
if (OSIntNesting == 0u) { /* Reschedule only if all ISRs complete ... */
if (OSLockNesting == 0u) { /* ... and not locked. */
OS_SchedNew();
OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy];
if (OSPrioHighRdy != OSPrioCur) { /* No Ctx Sw if current task is highest rdy */
#if OS_TASK_PROFILE_EN > 0u
OSTCBHighRdy->OSTCBCtxSwCtr++; /* Inc. # of context switches to this task */
#endif
OSCtxSwCtr++; /* Keep track of the number of ctx switches */
OSIntCtxSw(); /* Perform interrupt level ctx switch */
}
}
}
OS_EXIT_CRITICAL();
}
}
这个是原子时钟节拍中断,里面是不是有任务调度 |
|