mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-31 14:51:11 +03:00
adding rotary encoder + better jack gpio handling
This commit is contained in:
@@ -207,7 +207,11 @@ menu "Squeezelite-ESP32"
|
||||
int "Jack insertion GPIO"
|
||||
default -1
|
||||
help
|
||||
GPIO to detect speaker jack insertion (0 = inserted). Set to -1 for no detection
|
||||
GPIO to detect speaker jack insertion. Set to -1 for no detection
|
||||
config JACK_GPIO_LEVEL
|
||||
depends on JACK_GPIO != -1
|
||||
int "Level when inserted (0/1)"
|
||||
default 0
|
||||
endmenu
|
||||
|
||||
endmenu
|
||||
@@ -281,6 +281,9 @@ void register_default_nvs(){
|
||||
|
||||
ESP_LOGD(TAG,"Registering default Audio control board type %s, value ","actrls_config");
|
||||
config_set_default(NVS_TYPE_STR, "actrls_config", "", 0);
|
||||
|
||||
ESP_LOGD(TAG,"Registering default Audio control board type %s, value ","rotary_config");
|
||||
config_set_default(NVS_TYPE_STR, "rotary_config", "", 0);
|
||||
|
||||
char number_buffer[101] = {};
|
||||
snprintf(number_buffer,sizeof(number_buffer)-1,"%u",OTA_FLASH_ERASE_BLOCK);
|
||||
@@ -375,15 +378,12 @@ void app_main()
|
||||
|
||||
ESP_LOGD(TAG,"Getting audio control mapping ");
|
||||
char *actrls_config = config_alloc_get_default(NVS_TYPE_STR, "actrls_config", NULL, 0);
|
||||
if (actrls_config) {
|
||||
if(actrls_config[0] !='\0'){
|
||||
ESP_LOGD(TAG,"Initializing audio control buttons type %s", actrls_config);
|
||||
actrls_init_json(actrls_config, true);
|
||||
}
|
||||
free(actrls_config);
|
||||
if (actrls_init_json(actrls_config, true) == ESP_OK) {
|
||||
ESP_LOGD(TAG,"Initializing audio control buttons type %s", actrls_config);
|
||||
} else {
|
||||
ESP_LOGD(TAG,"No audio control buttons");
|
||||
}
|
||||
if (actrls_config) free(actrls_config);
|
||||
|
||||
/* start the wifi manager */
|
||||
ESP_LOGD(TAG,"Blinking led");
|
||||
|
||||
Reference in New Issue
Block a user