Skip to content

Commit

Permalink
Improved audio ui, bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sle118 committed Apr 7, 2023
1 parent 1e0fce5 commit 7ac628a
Show file tree
Hide file tree
Showing 34 changed files with 1,176 additions and 169 deletions.
4 changes: 2 additions & 2 deletions components/platform_config/platform_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void config_start_timer(){
nvs_type_t config_get_item_type(cJSON * entry){
if(entry==NULL){
ESP_LOGE(TAG,"null pointer received!");
return true;
return 0;
}
cJSON * item_type = cJSON_GetObjectItemCaseSensitive(entry, "type");
if(item_type ==NULL ) {
Expand All @@ -142,7 +142,7 @@ cJSON * config_set_value_safe(nvs_type_t nvs_type, const char *key, const void
return NULL;
}

cJSON * existing = cJSON_GetObjectItemCaseSensitive(nvs_json, key);
cJSON * existing = cJSON_GetObjectItemCaseSensitive(nvs_json, key);
if(existing !=NULL && nvs_type == NVS_TYPE_STR && config_get_item_type(existing) != NVS_TYPE_STR ) {
ESP_LOGW(TAG, "Storing numeric value from string");
numvalue = atof((char *)value);
Expand Down
10 changes: 4 additions & 6 deletions components/platform_console/app_squeezelite/cmd_squeezelite.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,19 @@ static void squeezelite_thread(void *arg){
for(int i = 0;i<thread_parms.argc; i++){
ESP_LOGV(TAG ," %s",thread_parms.argv[i]);
}

ESP_LOGI(TAG ,"Calling squeezelite");
int ret = squeezelite_main(thread_parms.argc, thread_parms.argv);

messaging_post_message(ret > 1 ? MESSAGING_ERROR : MESSAGING_WARNING,
MESSAGING_CLASS_SYSTEM, "squeezelite exited with error code %d", ret);
cmd_send_messaging("cfg-audio-tmpl",ret > 1 ? MESSAGING_ERROR : MESSAGING_WARNING,"squeezelite exited with error code %d\n", ret);

if (ret == 1) {
int wait = 60;
int wait = 60;
wait_for_commit();
messaging_post_message(MESSAGING_WARNING, MESSAGING_CLASS_SYSTEM, "Rebooting in %d sec", wait);
cmd_send_messaging("cfg-audio-tmpl",MESSAGING_ERROR,"Rebooting in %d sec\n", wait);
vTaskDelay( pdMS_TO_TICKS(wait * 1000));
esp_restart();
} else {
messaging_post_message(MESSAGING_ERROR, MESSAGING_CLASS_SYSTEM, "Correct command line and reboot");
cmd_send_messaging("cfg-audio-tmpl",MESSAGING_ERROR,"Correct command line and reboot\n");
vTaskSuspend(NULL);
}

Expand Down

0 comments on commit 7ac628a

Please sign in to comment.