Skip to content

Commit

Permalink
DIsable EIC before enabling
Browse files Browse the repository at this point in the history
Signed-off-by: Sara Damiano <[email protected]>
  • Loading branch information
SRGDamia1 committed Jan 13, 2025
1 parent 9c9621e commit 2fae34b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/WatchDogs/WatchDogSAMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ void extendedWatchDogSAMD::configureEICClock() {
// change it). This bit is not Write-Synchronized.
EIC->CTRLA.bit.CKSEL = 1; // 0 for GCLK_EIC, 1 for CLK_ULP32K

MS_DEEP_DBG(F("Disabling GCLK_EIC"));
GCLK->PCHCTRL[EIC_GCLK_ID].reg = GCLK_PCHCTRL_RESETVALUE;

MS_DEEP_DBG(F("Re-enabling the EIC"));
EIC->CTRLA.bit.ENABLE = 1;
while (EIC->SYNCBUSY.bit.ENABLE == 1) {}
Expand Down
4 changes: 0 additions & 4 deletions src/WatchDogs/WatchDogSAMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
*/
#define MAXIMUM_WATCHDOG_PERIOD 16UL


///
///

/**
* @brief The clock generator number to use for the watchdog timer and the
* external interrupt controller.
Expand Down

0 comments on commit 2fae34b

Please sign in to comment.