1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Fix I2S reported rate for 24b mode (#7838)

Adjust the number of bittimes when returning the real I2S rate.
This commit is contained in:
Earle F. Philhower, III 2021-01-24 09:59:20 -08:00 committed by GitHub
parent f0e8f8eac4
commit 349e67f7f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -502,7 +502,7 @@ void i2s_set_dividers(uint8_t div1, uint8_t div2) {
} }
float i2s_get_real_rate(){ 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) { bool i2s_rxtx_begin(bool enableRx, bool enableTx) {