We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82abc76 commit 5ab19e9Copy full SHA for 5ab19e9
libraries/I2S/src/I2S.cpp
@@ -78,7 +78,7 @@ bool I2S::setBuffers(size_t buffers, size_t bufferWords, int32_t silenceSample)
78
bool I2S::setFrequency(int newFreq) {
79
_freq = newFreq;
80
if (_running) {
81
- float bitClk = _freq * _bps * 2.0;
+ float bitClk = _freq * _bps * 2.0 /* channels */ * 2.0 /* edges per clock */;
82
pio_sm_set_clkdiv(_pio, _sm, (float)clock_get_hz(clk_sys) / bitClk);
83
}
84
return true;
0 commit comments