more muse (battery)

This commit is contained in:
Philippe G
2022-01-19 12:52:44 -08:00
parent b93f97c52b
commit 413ebcb912
6 changed files with 49 additions and 103 deletions

View File

@@ -974,11 +974,10 @@ cJSON * get_gpio_list(bool refresh) {
}
gpio_list= cJSON_CreateArray();
#ifndef CONFIG_BAT_LOCKED
char *bat_config = config_alloc_get_default(NVS_TYPE_STR, "bat_config", NULL, 0);
if (bat_config) {
int channel = -1;
PARSE_PARAM(bat_config, "channem", '=', channel);
PARSE_PARAM(bat_config, "channel", '=', channel);
if(channel != -1){
if(adc1_pad_get_io_num(channel,&gpio_num )==ESP_OK){
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","other",gpio_num,false));
@@ -986,11 +985,7 @@ cJSON * get_gpio_list(bool refresh) {
}
free(bat_config);
}
#else
if(adc1_pad_get_io_num(CONFIG_BAT_CHANNEL,&gpio_num )==ESP_OK){
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","other",gpio_num,true));
}
#endif
gpio_list=get_GPIO_nvs_list(gpio_list);
gpio_list=get_SPDIF_GPIO(gpio_list,is_spdif_config_locked());
gpio_list=get_Rotary_GPIO(gpio_list);