Skip to content

Commit b7b91d4

Browse files
committed
perform sanity checks if USB not connected and previous menu item was USB menu -> item set to 0 (volume)
Signed-off-by: Vincent-FK <[email protected]>
1 parent d05f503 commit b7b91d4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

RetroFE/Source/Menu/MenuMode.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,16 @@ void MenuMode::init_menu_system_values(){
417417
usb_data_connected = Utils::executeRawPath(SHELL_CMD_USB_DATA_CONNECTED);
418418
usb_sharing = Utils::executeRawPath(SHELL_CMD_USB_CHECK_IS_SHARING);
419419

420-
if(usb_sharing && !usb_data_connected){
421-
MENU_ERROR_PRINTF("WARNING usb_sharing && !usb_data_connected\n");
420+
/** Sanity check if usb not connected */
421+
if(!usb_data_connected){
422422
usb_sharing = 0;
423+
424+
if(idx_menus[menuItem] == MENU_TYPE_USB){
425+
menuItem = 0;
426+
}
423427
}
424428

429+
/** Sanity check if currently in USB sharing (should not happen) */
425430
if(usb_sharing){
426431

427432
/// Force USB menu to launch

0 commit comments

Comments
 (0)