"POP.D W0 \n" \\r
"POP SR " );\r
\r
-\r
- #define portSAVE_CONTEXT() \\r
- asm volatile( "PUSH SR \n" /* Save the SR used by the task.... */ \\r
- "PUSH W0 \n" /* ....then disable interrupts. */ \\r
- "MOV #32, W0 \n" \\r
- "MOV W0, SR \n" \\r
- "PUSH W1 \n" /* Save registers to the stack. */ \\r
- "PUSH.D W2 \n" \\r
- "PUSH.D W4 \n" \\r
- "PUSH.D W6 \n" \\r
- "PUSH.D W8 \n" \\r
- "PUSH.D W10 \n" \\r
- "PUSH.D W12 \n" \\r
- "PUSH W14 \n" \\r
- "PUSH RCOUNT \n" \\r
- "PUSH TBLPAG \n" \\r
- "PUSH CORCON \n" \\r
- "PUSH PSVPAG \n" \\r
- "MOV _uxCriticalNesting, W0 \n" /* Save the critical nesting counter for the task. */ \\r
- "PUSH W0 \n" \\r
- "MOV _pxCurrentTCB, W0 \n" /* Save the new top of stack into the TCB. */ \\r
- "MOV W15, [W0] ");\r
-\r
#endif /* MPLAB_PIC24_PORT */\r
\r
#ifdef MPLAB_DSPIC_PORT\r
"POP.D W0 \n" \\r
"POP SR " );\r
\r
-\r
- #define portSAVE_CONTEXT() \\r
- asm volatile( "PUSH SR \n" /* Save the SR used by the task.... */ \\r
- "PUSH W0 \n" /* ....then disable interrupts. */ \\r
- "MOV #32, W0 \n" \\r
- "MOV W0, SR \n" \\r
- "PUSH W1 \n" /* Save registers to the stack. */ \\r
- "PUSH.D W2 \n" \\r
- "PUSH.D W4 \n" \\r
- "PUSH.D W6 \n" \\r
- "PUSH.D W8 \n" \\r
- "PUSH.D W10 \n" \\r
- "PUSH.D W12 \n" \\r
- "PUSH W14 \n" \\r
- "PUSH RCOUNT \n" \\r
- "PUSH TBLPAG \n" \\r
- "PUSH ACCAL \n" \\r
- "PUSH ACCAH \n" \\r
- "PUSH ACCAU \n" \\r
- "PUSH ACCBL \n" \\r
- "PUSH ACCBH \n" \\r
- "PUSH ACCBU \n" \\r
- "PUSH DCOUNT \n" \\r
- "PUSH DOSTARTL \n" \\r
- "PUSH DOSTARTH \n" \\r
- "PUSH DOENDL \n" \\r
- "PUSH DOENDH \n" \\r
- "PUSH CORCON \n" \\r
- "PUSH PSVPAG \n" \\r
- "MOV _uxCriticalNesting, W0 \n" /* Save the critical nesting counter for the task. */ \\r
- "PUSH W0 \n" \\r
- "MOV _pxCurrentTCB, W0 \n" /* Save the new top of stack into the TCB. */ \\r
- "MOV W15, [W0] " );\r
-\r
#endif /* MPLAB_DSPIC_PORT */\r
\r
/*\r
}\r
/*-----------------------------------------------------------*/\r
\r
-/*\r
- * Manual context switch. This is similar to the tick context switch,\r
- * but does not increment the tick count. It must be identical to the\r
- * tick context switch in how it stores the stack of a task.\r
- */\r
-void vPortYield( void )\r
-{\r
- portSAVE_CONTEXT();\r
- vTaskSwitchContext();\r
- portRESTORE_CONTEXT();\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
/*\r
* Setup a timer for a regular tick.\r
*/\r
\r
void __attribute__((__interrupt__, auto_psv)) _T1Interrupt( void )\r
{\r
- vTaskIncrementTick();\r
-\r
/* Clear the timer interrupt. */\r
IFS0bits.T1IF = 0;\r
\r
+ vTaskIncrementTick();\r
+\r
#if configUSE_PREEMPTION == 1\r
portYIELD();\r
#endif\r