diff options
Diffstat (limited to 'libmaple/nvic.c')
-rw-r--r-- | libmaple/nvic.c | 16 |
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); + } +} + /** |