* |--------------------- Zero Flag set\r
* ---------------------- Global Interrupt Flag set (enabled)\r
*/\r
-#define portPSW ( 0xc6U )\r
+#define portPSW ( 0xc6UL )\r
\r
/* The address of the pxCurrentTCB variable, but don't know or need to know its\r
type. */\r
*/\r
static void prvSetupTimerInterrupt( void );\r
\r
+/*\r
+ * Defined in portasm.s87, this function starts the scheduler by loading the\r
+ * context of the first task to run.\r
+ */\r
+extern void vPortStartFirstTask( void );\r
+\r
/*-----------------------------------------------------------*/\r
\r
/*\r
prvSetupTimerInterrupt();\r
\r
/* Restore the context of the first task that is going to run. */\r
- vPortStart();\r
+ vPortStartFirstTask();\r
\r
/* Execution should not reach here as the tasks are now running! */\r
return pdTRUE;\r
#define CS 0xFFFFC\r
#define ES 0xFFFFD\r
\r
-; Functions implemented in this file\r
-;------------------------------------------------------------------------------\r
PUBLIC vPortYield\r
- PUBLIC vPortStart\r
+ PUBLIC vPortStartFirstTask\r
+ PUBLIC vPortTickISR\r
\r
-; Functions used by scheduler\r
-;------------------------------------------------------------------------------\r
EXTERN vTaskSwitchContext\r
EXTERN vTaskIncrementTick\r
\r
-; Tick ISR Prototype\r
-;------------------------------------------------------------------------------\r
- EXTERN ?CLRL78_V1_0_L00\r
-\r
- PUBWEAK `??MD_INTIT??INTVEC 56`\r
- PUBLIC MD_INTIT\r
-\r
-MD_INTIT SYMBOL "MD_INTIT"\r
-`??MD_INTIT??INTVEC 56` SYMBOL "??INTVEC 56", MD_INTIT\r
-\r
-\r
-\r
-;------------------------------------------------------------------------------\r
-; Yield to another task. Implemented as a software interrupt. The return\r
-; address and PSW will have been saved to the stack automatically before\r
-; this code runs.\r
-;\r
-; Input: NONE\r
-;\r
-; Call: CALL vPortYield\r
-;\r
-; Output: NONE\r
-;\r
-;------------------------------------------------------------------------------\r
+; FreeRTOS yield handler. This is installed as the BRK software interrupt\r
+; handler.\r
RSEG CODE:CODE\r
vPortYield:\r
portSAVE_CONTEXT ; Save the context of the current task.\r
retb\r
\r
\r
-;------------------------------------------------------------------------------\r
-; Restore the context of the first task that is going to run.\r
-;\r
-; Input: NONE\r
-;\r
-; Call: CALL vPortStart\r
-;\r
-; Output: NONE\r
-;\r
-;------------------------------------------------------------------------------ \r
+; Starts the scheduler by restoring the context of the task that will execute\r
+; first.\r
RSEG CODE:CODE\r
-vPortStart:\r
+vPortStartFirstTask:\r
portRESTORE_CONTEXT ; Restore the context of whichever task the ...\r
reti ; An interrupt stack frame is used so the task\r
; is started using a RETI instruction.\r
\r
-;------------------------------------------------------------------------------\r
-; Perform the necessary steps of the Tick Count Increment and Task Switch\r
-; depending on the chosen kernel configuration\r
-;\r
-; Input: NONE\r
-;\r
-; Call: ISR\r
-;\r
-; Output: NONE\r
-;\r
-;------------------------------------------------------------------------------ \r
-\r
-MD_INTIT:\r
+; FreeRTOS tick handler. This is installed as the interval timer interrupt\r
+; handler.\r
+vPortTickISR:\r
\r
portSAVE_CONTEXT ; Save the context of the current task.\r
call vTaskIncrementTick ; Call the timer tick function.\r
reti\r
\r
\r
+; Install the interrupt handlers\r
\r
- REQUIRE ?CLRL78_V1_0_L00\r
- COMMON INTVEC:CODE:ROOT(1) ; Set ISR location to the Interrupt vector table.\r
+ COMMON INTVEC:CODE:ROOT(1)\r
ORG 56\r
-`??MD_INTIT??INTVEC 56`:\r
- DW MD_INTIT\r
+ DW vPortTickISR\r
\r
- COMMON INTVEC:CODE:ROOT(1) ; Set ISR location to the Interrupt vector table.\r
+ COMMON INTVEC:CODE:ROOT(1)\r
ORG 126\r
-`??vPortYield??INTVEC 126`:\r
DW vPortYield\r
\r
- ; Set value for the usCriticalNesting.\r
- RSEG NEAR_ID:CONST:SORT:NOROOT(1)\r
-`?<Initializer for usCriticalNesting>`:\r
- DW 10\r
-\r
-;#endif\r
\r
END
\ No newline at end of file