Skip to content

Commit 1285d9d

Browse files
Correct I2S receive mode to be master
Fix mistake in merge. I2S recevive was in slave mode (external clock driven).
1 parent f2eabd6 commit 1285d9d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cores/esp8266/core_esp8266_i2s.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,14 @@ void i2s_set_dividers(uint8_t div1, uint8_t div2) {
381381
div1 &= I2SBDM;
382382
div2 &= I2SCDM;
383383

384-
// !trans master(?), !bits mod(==16 bits/chanel), clear clock dividers
385-
I2SC &= ~(I2STSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD));
384+
// !trans master(?), !recv master(?), !bits mod(==16 bits/chanel), clear clock dividers
385+
I2SC &= ~(I2STSM | I2SRSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD));
386386

387387
// I2SRF = Send/recv right channel first (? may be swapped form I2S spec of WS=0 => left)
388388
// I2SMR = MSB recv/xmit first
389-
// I2SRSM = Receive slave mode (?)
390389
// I2SRMS, I2STMS = 1-bit delay from WS to MSB (I2S format)
391390
// div1, div2 = Set I2S WS clock frequency. BCLK seems to be generated from 32x this
392-
I2SC |= I2SRF | I2SMR | I2SRSM | I2SRMS | I2STMS | (div1 << I2SBD) | (div2 << I2SCD);
391+
I2SC |= I2SRF | I2SMR | I2SRMS | I2STMS | (div1 << I2SBD) | (div2 << I2SCD);
393392
}
394393

395394
float i2s_get_real_rate(){

0 commit comments

Comments
 (0)