From 97436c3443db58bc802dc33e5d1a02763f5a48da Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 29 Mar 2010 20:27:35 +0000 Subject: Now it is working, honest. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1805 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/chcore.c | 2 ++ os/ports/GCC/ARMCMx/chcore.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'os/ports') diff --git a/os/ports/GCC/ARMCMx/chcore.c b/os/ports/GCC/ARMCMx/chcore.c index 9ed51d97e..9d0f6b060 100644 --- a/os/ports/GCC/ARMCMx/chcore.c +++ b/os/ports/GCC/ARMCMx/chcore.c @@ -80,6 +80,8 @@ void _port_switch_from_irq(void) { "mrs r1, XPSR \n\t" \ "push {r0, r1, lr} \n\t" \ "ldr r0, =_port_saved_pc \n\t" \ + "ldr r0, [r0] \n\t" \ + "add r0, r0, #1 \n\t" \ "str r0, [sp, #28]"); chSchDoRescheduleI(); diff --git a/os/ports/GCC/ARMCMx/chcore.h b/os/ports/GCC/ARMCMx/chcore.h index 4ee55dc4a..5a8d3c9ad 100644 --- a/os/ports/GCC/ARMCMx/chcore.h +++ b/os/ports/GCC/ARMCMx/chcore.h @@ -211,7 +211,8 @@ struct context { */ #define PORT_IRQ_EPILOGUE() { \ chSysLockFromIsr(); \ - if (((SCB_ICSR & ICSR_RETTOBASE) != 0) && chSchIsRescRequiredExI()) { \ + if (((SCB_ICSR & ICSR_VECTPENDING_MASK) == 0) && \ + chSchIsRescRequiredExI()) { \ register struct cmxctx *ctxp asm ("r3"); \ \ asm volatile ("mrs %0, PSP" : "=r" (ctxp) : "r" (ctxp)); \ -- cgit v1.2.3