diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-04-13 17:03:56 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-04-13 17:03:56 +0000 |
commit | 97ec157b500badfd14f4387ebb8e8a6bf3ac929e (patch) | |
tree | 3536a0c3cd7cc1633e4a9ee20ce9264dea80ed61 /ports/ARMCM3 | |
parent | 9e2c8595c8c07d14a2238019a33e00bc08928c92 (diff) | |
download | ChibiOS-97ec157b500badfd14f4387ebb8e8a6bf3ac929e.tar.gz ChibiOS-97ec157b500badfd14f4387ebb8e8a6bf3ac929e.tar.bz2 ChibiOS-97ec157b500badfd14f4387ebb8e8a6bf3ac929e.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@263 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports/ARMCM3')
-rw-r--r-- | ports/ARMCM3/chcore.c | 1 | ||||
-rw-r--r-- | ports/ARMCM3/nvic.c | 5 | ||||
-rw-r--r-- | ports/ARMCM3/nvic.h | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/ports/ARMCM3/chcore.c b/ports/ARMCM3/chcore.c index 5a718abc0..25ba2e85f 100644 --- a/ports/ARMCM3/chcore.c +++ b/ports/ARMCM3/chcore.c @@ -56,6 +56,7 @@ void chSysSwitchI(Thread *otp, Thread *ntp) { __attribute__((naked, weak))
void chSysHalt(void) {
+ chSysLock();
while (TRUE) {
}
}
diff --git a/ports/ARMCM3/nvic.c b/ports/ARMCM3/nvic.c index 5d62ba10b..c36229c9c 100644 --- a/ports/ARMCM3/nvic.c +++ b/ports/ARMCM3/nvic.c @@ -20,5 +20,8 @@ #include <ch.h>
#include <nvic.h>
-void SetNVICVector(void) {
+void NVICEnableVector(uint32_t n, uint32_t prio) {
+
+ NVIC_IPR(n >> 2) = (NVIC_IPR(n >> 2) & ~(0xFF << (n & 3))) | (prio << (n & 3));
+ NVIC_ISER(n >> 5) = 1 << (n & 0x1F);
}
diff --git a/ports/ARMCM3/nvic.h b/ports/ARMCM3/nvic.h index f7d513412..746a8b740 100644 --- a/ports/ARMCM3/nvic.h +++ b/ports/ARMCM3/nvic.h @@ -131,7 +131,7 @@ typedef struct { #ifdef __cplusplus
extern "C" {
#endif
- void SetNVICVector(void);
+ void NVICEnableVector(uint32_t n, uint32_t prio);
#ifdef __cplusplus
}
#endif
|