diff options
Diffstat (limited to 'apps/settings_menu.c')
-rw-r--r-- | apps/settings_menu.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 0b599ca0c6..b1204e2c1a 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -405,6 +405,12 @@ static bool clear_main_backdrop(void) | |||
405 | } | 405 | } |
406 | #endif | 406 | #endif |
407 | 407 | ||
408 | #ifdef HAVE_USB_POWER | ||
409 | #ifdef CONFIG_CHARGING | ||
410 | #include "usb.h" | ||
411 | #endif | ||
412 | #endif | ||
413 | |||
408 | #ifdef HAVE_LCD_COLOR | 414 | #ifdef HAVE_LCD_COLOR |
409 | /** | 415 | /** |
410 | * Menu for fore/back colors | 416 | * Menu for fore/back colors |
@@ -444,6 +450,22 @@ static bool reset_color(void) | |||
444 | } | 450 | } |
445 | #endif | 451 | #endif |
446 | 452 | ||
453 | #ifdef HAVE_USB_POWER | ||
454 | #ifdef CONFIG_CHARGING | ||
455 | /** | ||
456 | * Menu to switch the USB charging on or off | ||
457 | */ | ||
458 | static bool usb_charging(void) | ||
459 | { | ||
460 | bool rc = set_bool(str(LANG_USB_CHARGING), | ||
461 | &global_settings.usb_charging); | ||
462 | /* if (usb_charging_enabled() != global_settings.usb_charging) */ | ||
463 | usb_charging_enable(global_settings.usb_charging); | ||
464 | return rc; | ||
465 | } | ||
466 | #endif | ||
467 | #endif | ||
468 | |||
447 | /** | 469 | /** |
448 | * Menu to configure the battery display on status bar | 470 | * Menu to configure the battery display on status bar |
449 | */ | 471 | */ |
@@ -2083,6 +2105,11 @@ static bool battery_settings_menu(void) | |||
2083 | #if BATTERY_TYPES_COUNT > 1 | 2105 | #if BATTERY_TYPES_COUNT > 1 |
2084 | { ID2P(LANG_BATTERY_TYPE), battery_type }, | 2106 | { ID2P(LANG_BATTERY_TYPE), battery_type }, |
2085 | #endif | 2107 | #endif |
2108 | #ifdef HAVE_USB_POWER | ||
2109 | #ifdef CONFIG_CHARGING | ||
2110 | { ID2P(LANG_USB_CHARGING), usb_charging }, | ||
2111 | #endif | ||
2112 | #endif | ||
2086 | #else | 2113 | #else |
2087 | { "Dummy", NULL }, /* to have an entry at all, in the simulator */ | 2114 | { "Dummy", NULL }, /* to have an entry at all, in the simulator */ |
2088 | #endif | 2115 | #endif |