![]() ![]() The compiler uses two of the indirect memory registers as stack pointer and frame pointer. The tricky bit is the saving and restoring of the context which is very C18 specific. This way the ISR will return to the highest priority task. – Finally restores the current context which may be different to the context saved if vTaskSwitchContext() switched in another task. ![]() If the preemptive scheduler is not called this step is skipped as a context switch can only be caused by a call to portYIELD(). – If the preemptive scheduler is being used, vTaskSwitchContext() is called to switch to the highest priority task that is ready to run. – Call vTaskIncrementTick() which checks to see if any tasks are woken by the tick ISR. PrvTickISR() follows the same sequence as all the tick ISRs in all the ports, namely: PrvTickISR() is the function that implements the tick ISR (strangely), it is called by prvLowInterrupt() when the interrupt was generated by the timer. It first checks to see if the interrupt was caused by the timer and if so calls the Tick ISR, it then checks to see if it was caused by a character Rx and if so calls the serial port Rx interrupt etc. prvLowInterrupt() simple polls all the peripherals that could have caused the interrupt and call the appropriate ISR routine. The compatibility mode is used meaning that only one interrupt priority exists. PrvLowInterrupt() is the interrupt service routine. ![]() Ugliest of all the ports primarily because the compiler is not re-enterant so a whole chunk of global memory has to be saved as part of the context switch. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |