From 9703d324f65960fac5ae31b1edb91a7ea438ded6 Mon Sep 17 00:00:00 2001 From: daniel-k Date: Mon, 8 Jun 2015 15:31:01 +0200 Subject: [PATCH] samd21/rtt: fix bug in rtt_set_alarm that caused interrupt immediately after calling --- cpu/samd21/periph/rtt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/samd21/periph/rtt.c b/cpu/samd21/periph/rtt.c index 1d19c70426..3387be1057 100644 --- a/cpu/samd21/periph/rtt.c +++ b/cpu/samd21/periph/rtt.c @@ -116,8 +116,8 @@ void rtt_set_overflow_cb(rtt_cb_t cb, void *arg) /* Enable Overflow Interrupt and clear flag */ RtcMode0 *rtcMode0 = &(RTT_DEV); - rtcMode0->INTENSET.bit.OVF = 1; rtcMode0->INTFLAG.bit.OVF = 1; + rtcMode0->INTENSET.bit.OVF = 1; } void rtt_clear_overflow_cb(void) @@ -154,8 +154,8 @@ void rtt_set_alarm(uint32_t alarm, rtt_cb_t cb, void *arg) while (rtcMode0->STATUS.bit.SYNCBUSY); /* Enable Compare Interrupt and clear flag */ - rtcMode0->INTENSET.bit.CMP0 = 1; rtcMode0->INTFLAG.bit.CMP0 = 1; + rtcMode0->INTENSET.bit.CMP0 = 1; } void rtt_clear_alarm(void)