mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 19:47:02 +03:00
GPIO 7 erroneous access + few memory leaks - release
This commit is contained in:
@@ -372,7 +372,6 @@ static int do_i2c_set_display(int argc, char **argv)
|
||||
int result = 0;
|
||||
char * name = NULL;
|
||||
char * driver= NULL;
|
||||
char * err_message=malloc(1);
|
||||
char config_string[200]={};
|
||||
bool bHasi2cConfig = false, bHasSpiConfig=false;
|
||||
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&i2cdisp_args);
|
||||
@@ -383,20 +382,19 @@ static int do_i2c_set_display(int argc, char **argv)
|
||||
char * nvs_item = config_alloc_get(NVS_TYPE_STR, "i2c_config");
|
||||
if (nvs_item && strlen(nvs_item)>0) {
|
||||
bHasi2cConfig=true;
|
||||
FREE_AND_NULL(nvs_item);
|
||||
}
|
||||
FREE_AND_NULL(nvs_item);
|
||||
|
||||
nvs_item = config_alloc_get(NVS_TYPE_STR, "spi_config");
|
||||
if (nvs_item && strlen(nvs_item)>0) {
|
||||
bHasSpiConfig=true;
|
||||
FREE_AND_NULL(nvs_item);
|
||||
}
|
||||
FREE_AND_NULL(nvs_item);
|
||||
|
||||
/* Check "--clear" option */
|
||||
if (i2cdisp_args.clear->count) {
|
||||
log_send_messaging(MESSAGING_WARNING,"Display config cleared");
|
||||
config_set_value(NVS_TYPE_STR, "display_config", "");
|
||||
FREE_AND_NULL(err_message);
|
||||
return 0;
|
||||
}
|
||||
char *buf = NULL;
|
||||
|
||||
@@ -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);
|
||||
@@ -284,7 +284,7 @@ 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);
|
||||
|
||||
Reference in New Issue
Block a user