@ -73,7 +73,7 @@ IRQ_MODE EQU 0x12
INCLUDE p o r t A S M . h
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SVC handler is used to start the scheduler and yield a task.
; SVC handler is used to yield a task.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FreeRTOS_ S W I _ H a n d l e r
@ -83,11 +83,16 @@ FreeRTOS_SWI_Handler
portSAVE_ C O N T E X T
LDR R 0 , =vTaskSwitchContext
BLX R 0
portRESTORE_ C O N T E X T
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; vPortRestoreTaskContext is used to start the scheduler.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
vPortRestoreTaskContext
; Switch to system mode
CPS #S Y S _ M O D E
portRESTORE_ C O N T E X T
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; IRQ interrupt handler used when individual priorities cannot be masked
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -121,11 +126,14 @@ FreeRTOS_IRQ_Handler
AND r2 , r2 , #4
SUB s p , s p , r2
; Call the interrupt handler
; Obtain the address of the interrupt handler, then call it.
PUSH { r0 - r3 , l r }
LDR r1 , =configINTERRUPT_VECTOR_ADDRESS
LDR r0 , [ r1 ]
STR r1 , [ r1 ] ; Write to IVR in case protect mode is being used.
STR r1 , [ r1 ] ; [SAMA5] Write to IVR in case protect mode is being used.
DSB
ISB
CPSIE i
BLX r0
POP { r0 - r3 , l r }
ADD s p , s p , r2