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
This commit is contained in:
Solomon Peachy 2021-03-07 19:41:27 -05:00
parent 7c58b6f0db
commit c9e8d96e77
4 changed files with 12 additions and 10 deletions

View file

@ -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
);

View file

@ -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 */

View file

@ -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
};

View file

@ -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),