[riot-notifications] [RIOT] samd21: tidy up peripheral clocks and fix potential bugs (#3887)

Daniel Krebs notifications at github.com
Thu Sep 17 16:27:34 CEST 2015


While revising some clock setups I stumbled upon 2 potential bugs and eliminated some implicit options (`GCLK_CLKCTRL_GEN_GCLK0` evaluates to `0` but it's nice to see it if you don't know).

Additionally I redirect all peripherals to a disabled clock generator at the end of the cpu clock initialization. That saves approx. 1mA while MCU is executing, depending on the enabled peripherals. See [reference](http://atmel.force.com/support/articles/en_US/FAQ/Reducing-power-consumption-of-SAM-D21)
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * samd21: redirect all peripherals to a disabled clock generator by default
  * samd21/pwm: fix possible bug in pwm_poweroff and make clock code more explicit
  * samd21/gpio: make clock code more explicit
  * samd21/i2c: fix potential bug (GCLK_CLKCTRL_GEN_GCLK0 is already shifted)

-- File Changes --

    M cpu/samd21/cpu.c (6)
    M cpu/samd21/periph/gpio.c (5)
    M cpu/samd21/periph/i2c.c (12)
    M cpu/samd21/periph/pwm.c (18)

-- Patch Links --

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

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3887
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150917/cc07f9b5/attachment.html>


More information about the notifications mailing list