Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec76442

Browse files
authored
Hold transmitter in reset during rate change (#7248)
1 parent1bb5ccf commitec76442

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

‎cores/esp8266/core_esp8266_i2s.cpp‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,28 @@ void i2s_set_dividers(uint8_t div1, uint8_t div2) {
464464
div1 &= I2SBDM;
465465
div2 &= I2SCDM;
466466

467+
/*
468+
Following this post: https://github.com/esp8266/Arduino/issues/2590
469+
We should reset the transmitter while changing the configuration bits to avoid random distortion.
470+
*/
471+
472+
uint32_t i2sc_temp = I2SC;
473+
i2sc_temp |= (I2STXR);// Hold transmitter in reset
474+
I2SC = i2sc_temp;
475+
467476
// trans master(active low), recv master(active_low), !bits mod(==16 bits/chanel), clear clock dividers
468-
I2SC &= ~(I2STSM | I2SRSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD));
477+
i2sc_temp &= ~(I2STSM | I2SRSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD));
469478

470479
// I2SRF = Send/recv right channel first (? may be swapped form I2S spec of WS=0 => left)
471480
// I2SMR = MSB recv/xmit first
472481
// I2SRMS, I2STMS = 1-bit delay from WS to MSB (I2S format)
473482
// div1, div2 = Set I2S WS clock frequency. BCLK seems to be generated from 32x this
474-
I2SC |= I2SRF | I2SMR | I2SRMS | I2STMS | (div1 << I2SBD) | (div2 << I2SCD);
483+
i2sc_temp |= I2SRF | I2SMR | I2SRMS | I2STMS | (div1 << I2SBD) | (div2 << I2SCD);
484+
485+
I2SC = i2sc_temp;
486+
487+
i2sc_temp &= ~(I2STXR);// Release reset
488+
I2SC = i2sc_temp;
475489
}
476490

477491
floati2s_get_real_rate(){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp