1 #include "FreeRTOSConfig.h"
\r
3 portSAVE_CONTEXT macro
\r
16 mov.w &_usCriticalNesting, r14
\r
18 mov.w &_pxCurrentTCB, r12
\r
21 /*-----------------------------------------------------------*/
\r
23 portRESTORE_CONTEXT macro
\r
24 mov.w &_pxCurrentTCB, r12
\r
27 mov.w r15, &_usCriticalNesting
\r
42 /*-----------------------------------------------------------*/
\r
48 * The RTOS tick ISR.
\r
50 * If the cooperative scheduler is in use this simply increments the tick
\r
53 * If the preemptive scheduler is in use a context switch can also occur.
\r
58 call #_vTaskIncrementTick
\r
60 #if configUSE_PREEMPTION == 1
\r
61 call #_vTaskSwitchContext
\r
65 /*-----------------------------------------------------------*/
\r
69 * Manual context switch called by the portYIELD() macro.
\r
73 /* Mimic an interrupt by pushing the SR. */
\r
76 /* Now the SR is stacked we can disable interrupts. */
\r
79 /* Save the context of the current task. */
\r
82 /* Switch to the highest priority task that is ready to run. */
\r
83 call #_vTaskSwitchContext
\r
85 /* Restore the context of the new task. */
\r
87 /*-----------------------------------------------------------*/
\r
91 * Start off the scheduler by initialising the RTOS tick timer, then restoring
\r
92 * the context of the first task.
\r
94 _xPortStartScheduler::
\r
96 /* Setup the hardware to generate the tick. Interrupts are disabled
\r
97 when this function is called. */
\r
98 call #_prvSetupTimerInterrupt
\r
100 /* Restore the context of the first task that is going to run. */
\r
101 portRESTORE_CONTEXT
\r
102 /*-----------------------------------------------------------*/
\r
105 /* Place the tick ISR in the correct vector. */
\r