summaryrefslogtreecommitdiff
path: root/chopstx.c
diff options
context:
space:
mode:
Diffstat (limited to 'chopstx.c')
-rw-r--r--chopstx.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/chopstx.c b/chopstx.c
index 2d27d8c..ad5b97f 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -642,11 +642,16 @@ chx_timer_expired (void)
static void
chx_enable_intr (uint8_t irq_num)
{
- NVIC_ICPR (irq_num) = 1 << (irq_num & 0x1f); /* Clear pending. */
NVIC_ISER (irq_num) = 1 << (irq_num & 0x1f);
}
static void
+chx_clr_intr (uint8_t irq_num)
+{ /* Clear pending interrupt. */
+ NVIC_ICPR (irq_num) = 1 << (irq_num & 0x1f);
+}
+
+static void
chx_disable_intr (uint8_t irq_num)
{
NVIC_ICER (irq_num) = 1 << (irq_num & 0x1f);
@@ -1253,6 +1258,7 @@ chopstx_intr_wait (chopstx_intr_t *intr)
running->state = THREAD_WAIT_INT;
running->v = 0;
chx_sched (CHX_SLEEP);
+ chx_clr_intr (intr->irq_num);
}
else
chx_cpu_sched_unlock ();