From c9e8d96e77c9ad3e0ff2df3b1afbac77c33fde85 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 7 Mar 2021 19:41:27 -0500 Subject: [PATCH] ibasso: Fix the dx50/dx90 build (and usb_mode selection) (The usb_mode selection setting was actually broken even though it had been previously compiling...) Change-Id: I0cac31d24c0ef684b934e40ab14f683cc4a31738 --- apps/menus/settings_menu.c | 4 ++-- apps/settings.c | 11 ++++++----- apps/settings.h | 2 +- apps/settings_list.c | 5 +++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 5b96bca6c6..33d29b003c 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c @@ -266,7 +266,7 @@ MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON, &usb_charging, #endif ); -#if defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR) +#if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)) MENUITEM_SETTING(usb_mode, &global_settings.usb_mode, NULL); #endif /* Disk */ @@ -449,7 +449,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), #if defined(DX50) || defined(DX90) &governor, #endif -#if defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR) +#if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)) &usb_mode, #endif ); diff --git a/apps/settings.c b/apps/settings.c index 8b6db13234..43a010aeb2 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -1021,18 +1021,19 @@ void settings_apply(bool read_disk) usb_charging_enable(global_settings.usb_charging); #endif -#if defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR) - usb_set_mode(global_settings.usb_mode); -#endif - #ifdef HAVE_TOUCHSCREEN touchscreen_set_mode(global_settings.touch_mode); memcpy(&calibration_parameters, &global_settings.ts_calibration_data, sizeof(struct touchscreen_parameter)); #endif #if defined(DX50) || defined(DX90) - ibasso_set_governor(global_settings.governor); ibasso_set_usb_mode(global_settings.usb_mode); +#elif defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR) + usb_set_mode(global_settings.usb_mode); +#endif + +#if defined(DX50) || defined(DX90) + ibasso_set_governor(global_settings.governor); #endif /* This should stay last */ diff --git a/apps/settings.h b/apps/settings.h index 728e10bf30..60f2b44588 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -824,7 +824,7 @@ struct user_settings #if defined(DX50) || defined(DX90) int governor; #endif -#if defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR) +#if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)) int usb_mode; #endif }; diff --git a/apps/settings_list.c b/apps/settings_list.c index 40dbdfa152..cf52f26080 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -2161,7 +2161,7 @@ const struct settings_list settings[] = { "Powersave", "Performance"), #endif -#if defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR) +#if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)) CHOICE_SETTING(0, usb_mode, LANG_USB_MODE, @@ -2172,10 +2172,11 @@ const struct settings_list settings[] = { ",adb" #endif , - usb_set_mode, #if defined(DX50) || defined(DX90) + ibasso_set_usb_mode, 4, #else + usb_set_mode, 3, #endif ID2P(LANG_ASK),