aboutsummaryrefslogtreecommitdiffstats
path: root/ports
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-03-19 15:17:17 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-03-19 15:17:17 +0000
commitd63f9c27be96d7b947b18b82d4398c4aa95d71ba (patch)
tree9616bbbc197b53116aba5ce6ab32b562dd40f278 /ports
parent7eb7630d937ea87275bafee866e9fd6aaea61902 (diff)
downloadChibiOS-d63f9c27be96d7b947b18b82d4398c4aa95d71ba.tar.gz
ChibiOS-d63f9c27be96d7b947b18b82d4398c4aa95d71ba.tar.bz2
ChibiOS-d63f9c27be96d7b947b18b82d4398c4aa95d71ba.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@242 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports')
-rw-r--r--ports/ARMCM3-STM32F103/vectors.s6
-rw-r--r--ports/ARMCM3/chcore.c19
-rw-r--r--ports/ARMCM3/chcore.h2
3 files changed, 14 insertions, 13 deletions
diff --git a/ports/ARMCM3-STM32F103/vectors.s b/ports/ARMCM3-STM32F103/vectors.s
index ce400c747..21a5910c1 100644
--- a/ports/ARMCM3-STM32F103/vectors.s
+++ b/ports/ARMCM3-STM32F103/vectors.s
@@ -36,7 +36,7 @@ _vectors:
.word DebugMonitorVector
.word Vector34
.word PendSVVector
- .word Vector3C
+ .word SysTickVector
.word Vector40
.word Vector44
.word Vector48
@@ -120,8 +120,8 @@ Vector34:
.weak PendSVVector
PendSVVector:
-.weak Vector3C
-Vector3C:
+.weak SysTickVector
+SysTickVector:
.weak Vector40
Vector40:
diff --git a/ports/ARMCM3/chcore.c b/ports/ARMCM3/chcore.c
index e54d52542..01e4444bc 100644
--- a/ports/ARMCM3/chcore.c
+++ b/ports/ARMCM3/chcore.c
@@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "stm32lib/stm32f10x_map.h"
+
#include <ch.h>
/*
@@ -71,18 +73,13 @@ void threadstart(void) {
void *retaddr;
/*
- * Software-generated interrupt, it must have the lowest possible priority so
- * it is executed last in the interrupts tail-chain.
+ * System Timer vector.
*/
-void PendSVVector(void) {
+void SysTickVector(void) {
chSysLock();
-
- if (!chSchRescRequiredI()) {
-
- chSysUnlock();
- return;
- }
+ if (SCB->ICSR & (1 << 11)) { /* RETTOBASE */
+ if (chSchRescRequiredI()) {
asm volatile ("mrs r0, PSP \n\t" \
"ldr r1, =retaddr \n\t" \
@@ -90,6 +87,10 @@ void PendSVVector(void) {
"str r2, [r1] \n\t" \
"ldr r1, =threadswitch \n\t" \
"str r1, [r0, #18] ");
+ return;
+ }
+ }
+ chSysUnlock();
}
/*
diff --git a/ports/ARMCM3/chcore.h b/ports/ARMCM3/chcore.h
index 9fee0c61d..8d3a44892 100644
--- a/ports/ARMCM3/chcore.h
+++ b/ports/ARMCM3/chcore.h
@@ -26,7 +26,6 @@ typedef void *regarm;
* Interrupt saved context.
*/
struct extctx {
- regarm pc;
regarm xpsr;
regarm r0;
regarm r1;
@@ -34,6 +33,7 @@ struct extctx {
regarm r3;
regarm r12;
regarm lr;
+ regarm pc;
};
/*