[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

Fixes #10351.

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/12188

-- Commit Summary --

  * cpu/sam0_common/../rtt: correcly clear flags.

-- File Changes --

    M cpu/sam0_common/periph/rtt.c (4)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/12188.patch
https://github.com/RIOT-OS/RIOT/pull/12188.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12188
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190910/9cb98999/attachment.htm>


More information about the notifications mailing list