From f23dcac7b9235887b75fb4a04f715693ad99b34f Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sun, 18 Jul 2010 23:23:26 -0400 Subject: nvic_disable_interrupt --- libmaple/nvic.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libmaple/nvic.c') 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); + } +} + /** -- cgit v1.2.3