aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/nvic.c
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2010-07-18 23:23:26 -0400
committerbnewbold <bnewbold@robocracy.org>2010-07-18 23:23:26 -0400
commitf23dcac7b9235887b75fb4a04f715693ad99b34f (patch)
tree5c725fbbd0031728a1f0532a8b4c0c3f9e9dd815 /libmaple/nvic.c
parent2262a0d83164058b24733e5bad8e58b199bd5743 (diff)
downloadlibrambutan-f23dcac7b9235887b75fb4a04f715693ad99b34f.tar.gz
librambutan-f23dcac7b9235887b75fb4a04f715693ad99b34f.zip
nvic_disable_interrupt
Diffstat (limited to 'libmaple/nvic.c')
-rw-r--r--libmaple/nvic.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libmaple/nvic.c b/libmaple/nvic.c
index e540894..d8745a4 100644
--- a/libmaple/nvic.c
+++ b/libmaple/nvic.c
@@ -63,6 +63,22 @@ void nvic_enable_interrupt(uint32 n) {
}
}
+/**
+ * @brief turn off interrupt number n
+ * @param[in] n interrupt number
+ */
+void nvic_disable_interrupt(uint32 n) {
+ if (n >= NVIC_NR_INTERRUPTS) {
+ return;
+ }
+
+ if (n < 32) {
+ REG_SET_BIT(NVIC_ICER0, n);
+ } else {
+ REG_SET_BIT(NVIC_ICER1, n - 32);
+ }
+}
+
/**