Skip to content

Commit

Permalink
GPIO 7 might be used by error - release
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe44 committed Aug 19, 2020
1 parent 5e8a3fd commit ca97b80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/squeezelite/output_i2s.c
Expand Up @@ -228,7 +228,7 @@ void output_init_i2s(log_level level, char *device, unsigned output_buf_size, ch
char *dac_config = config_alloc_get_str("dac_config", CONFIG_DAC_CONFIG, "model=i2s,bck=" STR(CONFIG_I2S_BCK_IO)
",ws=" STR(CONFIG_I2S_WS_IO) ",do=" STR(CONFIG_I2S_DO_IO)
",sda=" STR(CONFIG_I2C_SDA) ",scl=" STR(CONFIG_I2C_SCL)
",mute" STR(CONFIG_MUTE_GPIO));
",mute=" STR(CONFIG_MUTE_GPIO));

i2s_pin_config_t i2s_dac_pin, i2s_spdif_pin;
set_i2s_pin(spdif_config, &i2s_spdif_pin);
Expand Down Expand Up @@ -284,15 +284,15 @@ void output_init_i2s(log_level level, char *device, unsigned output_buf_size, ch
char model[32] = "i2s";
if ((p = strcasestr(dac_config, "model")) != NULL) sscanf(p, "%*[^=]=%31[^,]", model);
if ((p = strcasestr(dac_config, "mute")) != NULL) {
char mute[8];
char mute[8] = "";
sscanf(p, "%*[^=]=%7[^,]", mute);
mute_control.gpio = atoi(mute);
if ((p = strchr(mute, ':')) != NULL) mute_control.active = atoi(p + 1);
}

for (int i = 0; adac == &dac_external && dac_set[i]; i++) if (strcasestr(dac_set[i]->model, model)) adac = dac_set[i];
res = adac->init(dac_config, I2C_PORT, &i2s_config) ? ESP_OK : ESP_FAIL;

res |= i2s_driver_install(CONFIG_I2S_NUM, &i2s_config, 0, NULL);
res |= i2s_set_pin(CONFIG_I2S_NUM, &i2s_dac_pin);

Expand Down

0 comments on commit ca97b80

Please sign in to comment.