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.
This commit is contained in:
Shahzada Khoso 2023-01-21 17:07:00 -05:00 committed by GitHub
parent 89833081ef
commit 84e222feb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -422,6 +422,7 @@ void I2SClass::enableClock(int divider)
GCLK->GENCTRL.bit.ID = _clockGenerator;
GCLK->GENCTRL.bit.SRC = src;
GCLK->GENCTRL.bit.IDC = 1;
GCLK->GENCTRL.bit.DIVSEL = 0;
GCLK->GENCTRL.bit.GENEN = 1;
// enable