[riot-notifications] [RIOT-OS/RIOT] cpu/sam0_common/../rtt: correcly clear flags. (#12188)
Juan I Carrano
notifications at github.com
Tue Sep 10 11:41:57 CEST 2019
### Contribution description
The INTFLAGS register is cleared by writing a 1 to the corresponding interrupt flag bit. From the samr21's manual:
> Writing a zero to this bit has no effect.
> Writing a one to this bit clears the Compare 0 interrupt flag.
This is a common pattern in 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.
### Testing procedure
I did not test this, I just read the manual and did what it says. I'm opening this PR because I think it does not make sense to have an open issue whose fix is only two lines.
### Issues/PRs references
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* cpu/sam0_common/../rtt: correcly clear flags.
-- File Changes --
M cpu/sam0_common/periph/rtt.c (4)
-- Patch Links --
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications