From 87ee6d10e002776b8461e873e54e990cf2e616a6 Mon Sep 17 00:00:00 2001 From: skorpsim <57116055+skorpsim@users.noreply.github.com> Date: Sun, 8 Dec 2019 17:12:03 +0100 Subject: [PATCH] Update I2S.cpp WDT patch enableClock() in I2S.cpp does not set DIVSEL bit but requires DIVSEL to be 0. All of the WDT's i have tested so far set DIVSEL to 1. This leads to incompatibilities. For example no sound with ArduinoSound and WDT --- libraries/I2S/src/I2S.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/I2S/src/I2S.cpp b/libraries/I2S/src/I2S.cpp index a62bc5114..cf5023583 100644 --- a/libraries/I2S/src/I2S.cpp +++ b/libraries/I2S/src/I2S.cpp @@ -419,6 +419,7 @@ void I2SClass::enableClock(int divider) // use the DFLL as the source while (GCLK->STATUS.bit.SYNCBUSY); + GCLK->GENCTRL.bit.DIVSEL = 0; GCLK->GENCTRL.bit.ID = _clockGenerator; GCLK->GENCTRL.bit.SRC = src; GCLK->GENCTRL.bit.IDC = 1;