]> git.sur5r.net Git - freertos/blobdiff - Demo/NEC_78K0R_IAR/ButtonISR.s26
Continue 78K0R development.
[freertos] / Demo / NEC_78K0R_IAR / ButtonISR.s26
index 9ddf257728e3bb86a5f48453817c7fd4ef8f7002..cef488cf46be59a08659a1aab40c5fc2aaad75ea 100644 (file)
 ;\r
 ;------------------------------------------------------------------------------\r
 \r
+;\r
+; This file defines a wrapper for the interrupt generated each time the button\r
+; on the target board is pushed.  The asm wrapper is used to save and restore\r
+; the task context as a context switch may occur within the ISR itself.\r
+; The C portion of the ISR is defined within ButtonTask.c.\r
+;\r
+\r
+; Include the portSAVE_CONTEXT and portRESTORE_CONTEXT macros.\r
 #include "ISR_Support.h"\r
 \r
        PUBLIC    vButtonISRWrapper\r
 \r
     RSEG CODE:CODE\r
        \r
-vButtonISRWrapper:     \r
+vButtonISRWrapper:\r
+       ; Save the current task context.        \r
        portSAVE_CONTEXT\r
+\r
+       ; Call the C portion of the ISR.\r
        call vButtonISRHandler\r
+\r
+       ; Restore the context of whichever task is to run next - which might be\r
+       ; different from the task that was originally interrupted.\r
        portRESTORE_CONTEXT\r
-       RETI\r
+       reti\r
 \r
 \r
 \r
-       ; Set ISR location to the Interrupt vector table.\r
+       ; Place the ISR into the vector table.\r
        COMMON INTVEC:CODE:ROOT(1)\r
        ORG 8\r
 `??vButtonISRWrapper??INTVEC 8`:\r