|
amiconn: apps settings.c, 1.254, 1.255 settings.h, 1.130, 1.131 settings_me: msg#00239systems.archos.rockbox.cvs
Update of /cvsroot/rockbox/apps In directory labb:/tmp/cvs-serv22759/apps Modified Files: settings.c settings.h settings_menu.c Log Message: New Ondio feature: Battery type setting, for correct battery level display. Index: settings.c =================================================================== RCS file: /cvsroot/rockbox/apps/settings.c,v retrieving revision 1.254 retrieving revision 1.255 diff -u -d -r1.254 -r1.255 --- settings.c 30 Jan 2005 13:48:44 -0000 1.254 +++ settings.c 30 Jan 2005 16:25:45 -0000 1.255 @@ -235,6 +235,10 @@ /* new stuff to be added here */ /* If values are just added to the end, no need to bump the version. */ +#if BATTERY_TYPES_COUNT > 1 + {1, S_O(battery_type), 0, "battery type", "alkaline,nimh" }, +#endif + /* Current sum of bits: 259 (worst case) */ /* Sum of all bit sizes must not grow beyond 288! */ }; @@ -759,6 +763,9 @@ #endif set_battery_capacity(global_settings.battery_capacity); +#if BATTERY_TYPES_COUNT > 1 + set_battery_type(global_settings.battery_type); +#endif #ifdef HAVE_LCD_BITMAP lcd_set_invert_display(global_settings.invert); Index: settings_menu.c =================================================================== RCS file: /cvsroot/rockbox/apps/settings_menu.c,v retrieving revision 1.168 retrieving revision 1.169 diff -u -d -r1.168 -r1.169 --- settings_menu.c 30 Jan 2005 13:48:44 -0000 1.168 +++ settings_menu.c 30 Jan 2005 16:25:45 -0000 1.169 @@ -707,6 +707,19 @@ &set_battery_capacity, 50, BATTERY_CAPACITY_MIN, BATTERY_CAPACITY_MAX ); } + +#if BATTERY_TYPES_COUNT > 1 +static bool battery_type(void) +{ + static const struct opt_items names[] = { + { STR(LANG_BATTERY_TYPE_ALKALINE) }, + { STR(LANG_BATTERY_TYPE_NIMH) } + }; + + return set_option(str(LANG_BATTERY_TYPE), &global_settings.battery_type, + INT, names, 2, set_battery_type); +} +#endif #endif #ifdef HAVE_CHARGE_CTRL @@ -1250,6 +1263,9 @@ #endif #ifndef SIMULATOR { ID2P(LANG_BATTERY_CAPACITY), battery_capacity }, +#if BATTERY_TYPES_COUNT > 1 + { ID2P(LANG_BATTERY_TYPE), battery_type }, +#endif #else #ifndef HAVE_CHARGE_CTRL { "Dummy", NULL }, /* to have an entry at all, in the simulator */ Index: settings.h =================================================================== RCS file: /cvsroot/rockbox/apps/settings.h,v retrieving revision 1.130 retrieving revision 1.131 diff -u -d -r1.130 -r1.131 --- settings.h 30 Jan 2005 13:48:44 -0000 1.130 +++ settings.h 30 Jan 2005 16:25:45 -0000 1.131 @@ -185,6 +185,7 @@ bool discharge; /* maintain charge of at least: false = 85%, true = 10% */ bool trickle_charge; /* do trickle charging: 0=off, 1=on */ int battery_capacity; /* in mAh */ + int battery_type; /* for units which can take multiple types (Ondio). */ /* resume settings */ _______________________________________________ http://cool.haxx.se/mailman/listinfo/rockbox-cvs |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | amiconn: firmware powermgmt.c,1.58,1.59: 00239, cvs |
|---|---|
| Next by Date: | amiconn: apps/lang english.lang,1.141,1.142: 00239, cvs |
| Previous by Thread: | amiconn: firmware powermgmt.c,1.58,1.59i: 00239, cvs |
| Next by Thread: | amiconn: apps/lang english.lang,1.141,1.142: 00239, cvs |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |