summaryrefslogtreecommitdiffstats
path: root/apps/settings_list.c
diff options
context:
space:
mode:
authorDana Conrad <dconrad@fastmail.com>2021-09-13 14:41:42 -0500
committerSolomon Peachy <pizza@shaftnet.org>2021-09-19 21:13:09 -0400
commit0ca0940f012566f8bb9d378386f97608d21ea8bc (patch)
tree1ea0f78e5554d034fdc3eabb93dd9d598dec4832 /apps/settings_list.c
parent5765deb08e538b0c9d02dd3cfe40cd857a5c69ef (diff)
downloadrockbox-0ca0940f012566f8bb9d378386f97608d21ea8bc.tar.gz
rockbox-0ca0940f012566f8bb9d378386f97608d21ea8bc.zip
Make USB Charging default value configurable per device
A reasonable default assumption for a user would be that they can plug their device into a USB AC adapter and it will charge with as much current as it reasonably can. With the previous default, an AC adapter will only do 100mA, basically a trickle charge. Make this configurable default per-device, so as not to break old devices without testing. Define TARGET_USB_CHARGING_DEFAULT to USB_CHARGING_FORCE to use the new default. Tested on both erosQ Native and M3K. Change-Id: I77265d356a41d67357ebc6e9f7e0c25a37b74931
Diffstat (limited to 'apps/settings_list.c')
-rw-r--r--apps/settings_list.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 4c92bb4322..d9ffd8cf3e 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -345,6 +345,12 @@ static const char graphic_numeric[] = "graphic,numeric";
#endif
#endif /* HAVE_BACKLIGHT */
+#if defined(HAVE_USB_CHARGING_ENABLE)
+# if !defined(TARGET_USB_CHARGING_DEFAULT)
+# define TARGET_USB_CHARGING_DEFAULT USB_CHARGING_ENABLE
+# endif
+#endif
+
#if LCD_DEPTH > 1
static const char* list_pad_formatter(char *buffer, size_t buffer_size,
int val, const char *unit)
@@ -1827,7 +1833,7 @@ const struct settings_list settings[] = {
#endif
TEXT_SETTING(0,kbd_file,"kbd","-",ROCKBOX_DIR "/",".kbd"),
#ifdef HAVE_USB_CHARGING_ENABLE
- CHOICE_SETTING(0, usb_charging, LANG_USB_CHARGING, 1, "usb charging",
+ CHOICE_SETTING(0, usb_charging, LANG_USB_CHARGING, TARGET_USB_CHARGING_DEFAULT, "usb charging",
"off,on,force", NULL, 3, ID2P(LANG_SET_BOOL_NO),
ID2P(LANG_SET_BOOL_YES), ID2P(LANG_FORCE)),
#endif