diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-03 19:54:25 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-03 19:54:25 +0000 |
commit | 58eb784a5d1f0ac800e656d5dfa3a1bff8fb2657 (patch) | |
tree | 084c7b7c5d374fbfef2f8cddb3673a3b2a26a7df /apps | |
parent | 0d0cc039f88ced4f6db5c4468b19913f52cd08c8 (diff) | |
download | rockbox-58eb784a5d1f0ac800e656d5dfa3a1bff8fb2657.tar.gz rockbox-58eb784a5d1f0ac800e656d5dfa3a1bff8fb2657.zip |
Straighten out some powermanagement stuff. Give target complete control over how power inputs are sensed. Clean SIMULATOR stuff out of target files. Get rid of USB charging option on targets that don't support it or don't implement it yet. Menu string remains to avoid language incompatibility but should be removed on next cleanup for targets not using it (notice in english.lang). global_settings becomes incompatible for some builds and so plugin API version is incremented.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19315 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 2 | ||||
-rw-r--r-- | apps/menus/settings_menu.c | 10 | ||||
-rw-r--r-- | apps/plugin.h | 4 | ||||
-rw-r--r-- | apps/screens.c | 6 | ||||
-rw-r--r-- | apps/settings.c | 4 | ||||
-rw-r--r-- | apps/settings.h | 4 | ||||
-rw-r--r-- | apps/settings_list.c | 4 |
7 files changed, 10 insertions, 24 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 4a8d81dfbc..60e36db79f 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -8321,7 +8321,7 @@ </phrase> <phrase> id: LANG_USB_CHARGING - desc: in Battery menu + desc: in Battery menu, TODO: cleanup unless HAVE_USB_CHARGING_ENABLE defined user: <source> *: none diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 6bb032d169..d05726ea44 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c @@ -144,8 +144,7 @@ MENUITEM_SETTING(battery_capacity, &global_settings.battery_capacity, NULL); #if BATTERY_TYPES_COUNT > 1 MENUITEM_SETTING(battery_type, &global_settings.battery_type, NULL); #endif -#ifdef HAVE_USB_POWER -#if CONFIG_CHARGING +#ifdef HAVE_USB_CHARGING_ENABLE static int usbcharging_callback(int action,const struct menu_item_ex *this_item) { (void)this_item; @@ -158,8 +157,7 @@ static int usbcharging_callback(int action,const struct menu_item_ex *this_item) return action; } MENUITEM_SETTING(usb_charging, &global_settings.usb_charging, usbcharging_callback); -#endif -#endif +#endif /* HAVE_USB_CHARGING_ENABLE */ MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON, #if BATTERY_CAPACITY_INC > 0 &battery_capacity, @@ -167,11 +165,9 @@ MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON, #if BATTERY_TYPES_COUNT > 1 &battery_type, #endif -#ifdef HAVE_USB_POWER -#if CONFIG_CHARGING +#ifdef HAVE_USB_CHARGING_ENABLE &usb_charging, #endif -#endif ); /* Disk */ #ifdef HAVE_DISK_STORAGE diff --git a/apps/plugin.h b/apps/plugin.h index 464614dcf9..99a76ad399 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -131,12 +131,12 @@ void* plugin_get_buffer(size_t *buffer_size); #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 126 +#define PLUGIN_API_VERSION 127 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any new function which are "waiting" at the end of the function table) */ -#define PLUGIN_MIN_API_VERSION 125 +#define PLUGIN_MIN_API_VERSION 127 /* plugin return codes */ enum plugin_status { diff --git a/apps/screens.c b/apps/screens.c index 2bd7775569..6d16982dc4 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -906,11 +906,7 @@ bool view_runtime(void) while(1) { #if CONFIG_CHARGING - if (charger_inserted() -#ifdef HAVE_USB_POWER - || usb_powered() -#endif - ) + if (charger_inserted()) { global_status.runtime = 0; } diff --git a/apps/settings.c b/apps/settings.c index 609cb3f93f..f8c9acd151 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -717,11 +717,9 @@ void sound_settings_apply(void) sound_set(SOUND_TREBLE_CUTOFF, global_settings.treble_cutoff); #endif -#ifdef HAVE_USB_POWER -#if CONFIG_CHARGING +#ifdef HAVE_USB_CHARGING_ENABLE usb_charging_enable(global_settings.usb_charging); #endif -#endif } void settings_apply(bool read_disk) diff --git a/apps/settings.h b/apps/settings.h index be83689368..f79fb9d09e 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -684,11 +684,9 @@ struct user_settings unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */ #endif -#ifdef HAVE_USB_POWER -#if CONFIG_CHARGING +#ifdef HAVE_USB_CHARGING_ENABLE bool usb_charging; #endif -#endif bool hold_lr_for_scroll_in_list; /* hold L/R scrolls the list left/right */ #ifdef HAVE_LCD_BITMAP diff --git a/apps/settings_list.c b/apps/settings_list.c index fe379ca229..2678fe0861 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -1310,11 +1310,9 @@ const struct settings_list settings[] = { #ifdef HAVE_LCD_BITMAP TEXT_SETTING(0,kbd_file,"kbd","",ROCKBOX_DIR "/",".kbd"), #endif -#ifdef HAVE_USB_POWER -#if CONFIG_CHARGING +#ifdef HAVE_USB_CHARGING_ENABLE OFFON_SETTING(0,usb_charging,LANG_USB_CHARGING,false,"usb charging",NULL), #endif -#endif OFFON_SETTING(F_BANFROMQS,cuesheet,LANG_CUESHEET_ENABLE,false,"cuesheet support", NULL), TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, skip_length, |