diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-04-18 12:33:52 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-04-18 12:33:52 +0000 |
commit | 792c528dbc75f0ffeb19766594607bee73fa36ad (patch) | |
tree | 5ba15b026fe89c4993dd92af6fecb35f9e1179aa /ports/ARMCM3/nvic.c | |
parent | f71ba1635af2197a9543a37ea2b19a608a28320f (diff) | |
download | ChibiOS-792c528dbc75f0ffeb19766594607bee73fa36ad.tar.gz ChibiOS-792c528dbc75f0ffeb19766594607bee73fa36ad.tar.bz2 ChibiOS-792c528dbc75f0ffeb19766594607bee73fa36ad.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@270 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports/ARMCM3/nvic.c')
-rw-r--r-- | ports/ARMCM3/nvic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ports/ARMCM3/nvic.c b/ports/ARMCM3/nvic.c index c36229c9c..dbb4935c0 100644 --- a/ports/ARMCM3/nvic.c +++ b/ports/ARMCM3/nvic.c @@ -21,7 +21,8 @@ #include <nvic.h>
void NVICEnableVector(uint32_t n, uint32_t prio) {
+ int sh = (n & 3) << 3;
- NVIC_IPR(n >> 2) = (NVIC_IPR(n >> 2) & ~(0xFF << (n & 3))) | (prio << (n & 3));
+ NVIC_IPR(n >> 2) = (NVIC_IPR(n >> 2) & ~(0xFF << sh)) | (prio << sh);
NVIC_ISER(n >> 5) = 1 << (n & 0x1F);
}
|