diff options
Diffstat (limited to 'ports/ARMCM3/chcore.c')
-rw-r--r-- | ports/ARMCM3/chcore.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ports/ARMCM3/chcore.c b/ports/ARMCM3/chcore.c index 01e4444bc..94a734dba 100644 --- a/ports/ARMCM3/chcore.c +++ b/ports/ARMCM3/chcore.c @@ -77,6 +77,19 @@ void *retaddr; */
void SysTickVector(void) {
+ chSysIRQEnterI();
+
+ chSysTimerHandlerI();
+
+ chSysIRQExitI();
+}
+
+/*
+ * To be invoked at the end of any interrupt handler that can trigger a
+ * reschedule.
+ */
+void chSysIRQExitI(void) {
+
chSysLock();
if (SCB->ICSR & (1 << 11)) { /* RETTOBASE */
if (chSchRescRequiredI()) {
@@ -87,7 +100,7 @@ void SysTickVector(void) { "str r2, [r1] \n\t" \
"ldr r1, =threadswitch \n\t" \
"str r1, [r0, #18] ");
- return;
+ return; /* Note, returns *without* re-enabling interrupts.*/
}
}
chSysUnlock();
|