Skip to content

Commit 733637f

Browse files
committed
i2s: don't use apll workaround on Rev.0 chip
1 parent 2c8993f commit 733637f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main/src/chip/i2s.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313

1414
#define TAG "i2s"
1515

16+
static esp_chip_info_t chip_info;
17+
1618
static int i2s0_sample_rate = 48000;
1719
static int i2s0_bits_per_sample = 16;
1820

1921
void i2s0_init(void)
2022
{
21-
esp_chip_info_t chip_info;
2223
esp_chip_info(&chip_info);
2324
i2s_config_t i2s_config = {
2425
.mode = I2S_MODE_MASTER | I2S_MODE_TX, // Only TX
@@ -46,7 +47,7 @@ void i2s0_set_sample_rate(int rate)
4647
{
4748
if (rate != i2s0_sample_rate) {
4849
// workaround as i2s apll clock is inaccurate at 44100Hz 16-bit 2ch
49-
if (rate == 44100) {
50+
if (rate == 44100 && chip_info.revision) {
5051
rtc_clk_apll_enable(1, 15, 8, 5, 6);
5152
ESP_LOGW(TAG, "enable workaround for i2s apll clock at 44100Hz 16-bit 2ch");
5253
} else {

0 commit comments

Comments
 (0)