aboutsummaryrefslogtreecommitdiffstats
path: root/ports/ARMCM3
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-04-14 12:25:50 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-04-14 12:25:50 +0000
commit1eabb376cdaeb42a7421c123d0e1fabd59f6c2d1 (patch)
treebff17bc4514d2baf5a129d2119904babe9145494 /ports/ARMCM3
parent97ec157b500badfd14f4387ebb8e8a6bf3ac929e (diff)
downloadChibiOS-1eabb376cdaeb42a7421c123d0e1fabd59f6c2d1.tar.gz
ChibiOS-1eabb376cdaeb42a7421c123d0e1fabd59f6c2d1.tar.bz2
ChibiOS-1eabb376cdaeb42a7421c123d0e1fabd59f6c2d1.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@264 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports/ARMCM3')
-rw-r--r--ports/ARMCM3/chcore.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ports/ARMCM3/chcore.c b/ports/ARMCM3/chcore.c
index 25ba2e85f..4f4019706 100644
--- a/ports/ARMCM3/chcore.c
+++ b/ports/ARMCM3/chcore.c
@@ -76,7 +76,11 @@ void threadstart(void) {
void SysTickVector(void) {
chSysIRQEnterI();
+ chSysLock();
+
chSysTimerHandlerI();
+
+ chSysUnlock();
chSysIRQExitI();
}
@@ -94,7 +98,6 @@ void chSysIRQExitI(void) {
asm volatile ("mrs r0, PSP \n\t" \
"ldr r2, [r0, #24] \n\t" \
- "orr r2, r2, #1 \n\t" \
"ldr r1, =retaddr \n\t" \
"str r2, [r1] \n\t" \
"ldr r1, =threadswitch \n\t" \
@@ -118,6 +121,7 @@ void threadswitch(void) {
"push {r0} \n\t" \
"ldr r0, =retaddr \n\t" \
"ldr r0, [r0] \n\t" \
+ "orr r0, r0, #1 \n\t" \
"str r0, [sp, #28] \n\t" \
"bl chSchDoRescheduleI \n\t" \
"pop {r0} \n\t" \