From dc9bf678652d4c39379ce33e5bd48ae9e8360cc4 Mon Sep 17 00:00:00 2001 From: aalbinati <66640950+aalbinati@users.noreply.github.com> Date: Sun, 3 Jan 2021 15:59:40 -0300 Subject: [PATCH] Disable EIC clock while also set GCLK_CTRL_CLKEN bit to 0 This commit fixes issue #30 --- src/samd/ArduinoLowPower.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/samd/ArduinoLowPower.cpp b/src/samd/ArduinoLowPower.cpp index 1ba0f7c..226487c 100644 --- a/src/samd/ArduinoLowPower.cpp +++ b/src/samd/ArduinoLowPower.cpp @@ -5,7 +5,7 @@ static void configGCLK6() { // enable EIC clock - GCLK->CLKCTRL.bit.CLKEN = 0; //disable GCLK module + GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCM_EIC)); // Disable EIC clock (also sets GCLK_CTRL_CLKEN bit to 0) while (GCLK->STATUS.bit.SYNCBUSY); GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK6 | GCLK_CLKCTRL_ID( GCM_EIC )) ; //EIC clock switched on GCLK6