sam0_common/periph/rtt: Interrupt flags are not correctly cleared #10351
Labels
Area: cpu
Area: CPU/MCU ports
Area: drivers
Area: Device drivers
Area: timers
Area: timer subsystems
State: don't stale
State: Tell state-bot to ignore this issue
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Description
The
INTFLAGS
register is cleared by writing a 1 to the corresponding interrupt flag bit. Flags that must not be cleared should be written as zero. This is a pretty common behaviour for interrupt flag registers.This RTT driver is using or-equal to clear the flags, which means it can possibly clear other interrupts. There's a small chance that one event is missed if it happens very close to another event.
see:
RIOT/cpu/samd21/periph/rtt.c
Line 201 in 12049a5
and
RIOT/cpu/samd21/periph/rtt.c
Line 206 in 12049a5
The correct thing to write is:
rtcMode0->INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0;
References
From the samr21's manual:
The text was updated successfully, but these errors were encountered: