Commit 99e391bf authored by natalie's avatar natalie 💜
Browse files

Always clear out queue when stopping player

parent b72304ae
......@@ -122,6 +122,8 @@ static void file_error() {
modal_show_simple(TAG, "SD Card Error", "There was an error reading the VGM from the SD card.\nPlease check that the card is inserted and try again.", LV_SYMBOL_OK " OK");
running = false;
xTaskNotify(Taskmgr_Handles[TASK_PLAYER], PLAYER_NOTIFY_STOP_RUNNING, eSetValueWithoutOverwrite);
QueueLength = 0;
QueuePosition = 0;
Ui_Screen = UISCREEN_MAINMENU;
Sdcard_Online = false;
ESP_LOGE(TAG, "IO error");
......
......@@ -99,6 +99,8 @@ void Ui_ShuffleAll_Setup(lv_obj_t *uiscreen) {
xTaskNotify(Taskmgr_Handles[TASK_PLAYER], PLAYER_NOTIFY_STOP_RUNNING, eSetValueWithoutOverwrite);
ESP_LOGI(TAG, "wait player stop");
xEventGroupWaitBits(Player_Status, PLAYER_STATUS_NOT_RUNNING, false, true, pdMS_TO_TICKS(3000));
QueueLength = 0;
QueuePosition = 0;
LcdDma_Mutex_Take(pdMS_TO_TICKS(1000));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment