[riot-notifications] [RIOT-OS/RIOT] cpu/sam0_common: RTC cleanup (#14032)

benpicco notifications at github.com
Wed May 6 14:15:04 CEST 2020


### Contribution description

RTC `INTFLAG` is clear on write - writing a 1 bit clears the interrupt flag, writing with `|=` is thus
unnecessary (and actually an error as this would clear *all* flags).

This cleanup was already done for `rtt.c`, but `rtc.c` missed out.

Also fix formatting issues to make the code easier to read.

### Testing procedure

`tests/periph_rtc` still works.

```
2020-05-06 14:12:22,292 # This test will display 'Alarm!' every 2 seconds for 4 times
2020-05-06 14:12:22,296 #   Setting clock to   2020-02-28 23:59:57
2020-05-06 14:12:22,302 # Clock value is now   2020-02-28 23:59:57
2020-05-06 14:12:22,306 #   Setting alarm to   2020-02-28 23:59:59
2020-05-06 14:12:22,312 #    Alarm is set to   2020-02-28 23:59:59
2020-05-06 14:12:22,312 # 
2020-05-06 14:12:24,554 # Alarm!
2020-05-06 14:12:26,554 # Alarm!
2020-05-06 14:12:28,554 # Alarm!
2020-05-06 14:12:30,554 # Alarm!
```


### Issues/PRs references

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

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

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

-- Commit Summary --

  * cpu/sam0_common: RTC INTFLAG are clear on write
  * cpu/sam0_common: clean up formatting

-- File Changes --

    M cpu/sam0_common/periph/rtc.c (35)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/14032.patch
https://github.com/RIOT-OS/RIOT/pull/14032.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/14032
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200506/406af33e/attachment.htm>


More information about the notifications mailing list