Skip to content

Commit

Permalink
Fix I2S reported rate for 24b mode (#7838)
Browse files Browse the repository at this point in the history
Adjust the number of bittimes when returning the real I2S rate.
  • Loading branch information
earlephilhower authored Jan 24, 2021
1 parent f0e8f8e commit 349e67f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cores/esp8266/core_esp8266_i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ void i2s_set_dividers(uint8_t div1, uint8_t div2) {
}

float i2s_get_real_rate(){
return (float)I2SBASEFREQ/32/((I2SC>>I2SBD) & I2SBDM)/((I2SC >> I2SCD) & I2SCDM);
return (float)I2SBASEFREQ/(_i2s_bits * 2)/((I2SC>>I2SBD) & I2SBDM)/((I2SC >> I2SCD) & I2SCDM);
}

bool i2s_rxtx_begin(bool enableRx, bool enableTx) {
Expand Down

0 comments on commit 349e67f

Please sign in to comment.