Skip to content

Commit 84e222f

Browse files
authored
Update I2S.cpp to work with RTCZero library
I2S.cpp configures the clock without specifying what to GLCK->DIVSEL bit. This causes issues when the bit is set to 1 by other libraries such as RTCZero. Explicitly setting this value fixes the problem.
1 parent 8983308 commit 84e222f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libraries/I2S/src/I2S.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ void I2SClass::enableClock(int divider)
422422
GCLK->GENCTRL.bit.ID = _clockGenerator;
423423
GCLK->GENCTRL.bit.SRC = src;
424424
GCLK->GENCTRL.bit.IDC = 1;
425+
GCLK->GENCTRL.bit.DIVSEL = 0;
425426
GCLK->GENCTRL.bit.GENEN = 1;
426427

427428
// enable

0 commit comments

Comments
 (0)