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
This commit is contained in:
Michael Sevakis 2008-12-03 19:54:25 +00:00
parent 0d0cc039f8
commit 58eb784a5d
41 changed files with 284 additions and 403 deletions

View file

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

View file

@ -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,10 +165,8 @@ 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 */

View file

@ -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 {

View file

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

View file

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

View file

@ -684,10 +684,8 @@ 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 */

View file

@ -1310,10 +1310,8 @@ 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),