;\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