[riot-commits] [RIOT-OS/RIOT] f7279c: cpu/sam0_common: rtt: correcly clear flags.

benpicco noreply at github.com
Wed Sep 11 15:24:49 CEST 2019


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: f7279c84bbab92f5f2322b996555d6402c028b53
      https://github.com/RIOT-OS/RIOT/commit/f7279c84bbab92f5f2322b996555d6402c028b53
  Author: Juan Carrano <j.carrano at fu-berlin.de>
  Date:   2019-09-11 (Wed, 11 Sep 2019)

  Changed paths:
    M cpu/sam0_common/periph/rtt.c

  Log Message:
  -----------
  cpu/sam0_common: rtt: correcly clear flags.

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.

Credits to @benpicco, @dylad for pointing out missing fixes.


  Commit: c12b88ef5994156bc61464549f3c6687e2fc5d7e
      https://github.com/RIOT-OS/RIOT/commit/c12b88ef5994156bc61464549f3c6687e2fc5d7e
  Author: benpicco <benpicco at googlemail.com>
  Date:   2019-09-11 (Wed, 11 Sep 2019)

  Changed paths:
    M cpu/sam0_common/periph/rtt.c

  Log Message:
  -----------
  Merge pull request #12188 from jcarrano/sam0_rtt_fix_flags

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


Compare: https://github.com/RIOT-OS/RIOT/compare/6c35e86e9591...c12b88ef5994


More information about the commits mailing list