diff options
Diffstat (limited to 'os/ports/GCC/ARMCM3/nvic.c')
-rw-r--r-- | os/ports/GCC/ARMCM3/nvic.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/os/ports/GCC/ARMCM3/nvic.c b/os/ports/GCC/ARMCM3/nvic.c index 4a11cbb39..e992427fd 100644 --- a/os/ports/GCC/ARMCM3/nvic.c +++ b/os/ports/GCC/ARMCM3/nvic.c @@ -32,6 +32,7 @@ *
* @param n the interrupt number
* @param prio the interrupt priority
+ *
* @note The parameters are not tested for correctness.
*/
void NVICEnableVector(uint32_t n, uint32_t prio) {
@@ -42,6 +43,20 @@ void NVICEnableVector(uint32_t n, uint32_t prio) { }
/**
+ * @brief Disables an interrupt handler.
+ *
+ * @param n the interrupt number
+ *
+ * @note The parameters are not tested for correctness.
+ */
+void NVICDisableVector(uint32_t n) {
+ unsigned sh = (n & 3) << 3;
+
+ NVIC_ICER(n >> 5) = 1 << (n & 0x1F);
+ NVIC_IPR(n >> 2) = NVIC_IPR(n >> 2) & ~(0xFF << sh);
+}
+
+/**
* @brief Changes the priority of a system handler.
* * @param handler the system handler number |