From b7b91d4aaee74768e23d2a5e96700af86b6b96e2 Mon Sep 17 00:00:00 2001 From: Vincent-FK Date: Wed, 30 Sep 2020 14:19:57 +0200 Subject: [PATCH] perform sanity checks if USB not connected and previous menu item was USB menu -> item set to 0 (volume) Signed-off-by: Vincent-FK --- RetroFE/Source/Menu/MenuMode.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/RetroFE/Source/Menu/MenuMode.cpp b/RetroFE/Source/Menu/MenuMode.cpp index a51ab3a..95fecc8 100755 --- a/RetroFE/Source/Menu/MenuMode.cpp +++ b/RetroFE/Source/Menu/MenuMode.cpp @@ -417,11 +417,16 @@ void MenuMode::init_menu_system_values(){ usb_data_connected = Utils::executeRawPath(SHELL_CMD_USB_DATA_CONNECTED); usb_sharing = Utils::executeRawPath(SHELL_CMD_USB_CHECK_IS_SHARING); - if(usb_sharing && !usb_data_connected){ - MENU_ERROR_PRINTF("WARNING usb_sharing && !usb_data_connected\n"); + /** Sanity check if usb not connected */ + if(!usb_data_connected){ usb_sharing = 0; + + if(idx_menus[menuItem] == MENU_TYPE_USB){ + menuItem = 0; + } } + /** Sanity check if currently in USB sharing (should not happen) */ if(usb_sharing){ /// Force USB menu to launch