? apps.diff
? fm
? play
? power.diff
? rec
? tools/bmp2rb
? tools/convbdf
? tools/descramble
? tools/generate_rocklatin
? tools/scramble
? tools/sh2d
Index: apps/debug_menu.c
===================================================================
RCS file: /cvsroot/rockbox/apps/debug_menu.c,v
retrieving revision 1.42
diff -u -r1.42 debug_menu.c
--- apps/debug_menu.c	12 Feb 2003 22:21:07 -0000	1.42
+++ apps/debug_menu.c	19 Feb 2003 20:58:57 -0000
@@ -759,7 +759,12 @@
 #ifdef HAVE_CHARGE_CTRL
                 snprintf(buf, 30, "Charging: %s", 
                          charger_enabled ? "yes" : "no");
+#else
+#ifdef HAVE_FMADC
+                snprintf(buf, 30, "Charging: %s", 
+                         (charger_inserted() && (y > 350)) ? "yes" : "no");
                 lcd_puts(0, 4, buf);
+#endif                
 #endif                
                 y = ( power_history[POWER_HISTORY_LEN-1] * 100
                     + power_history[POWER_HISTORY_LEN-2] * 100
Index: apps/status.c
===================================================================
RCS file: /cvsroot/rockbox/apps/status.c,v
retrieving revision 1.39
diff -u -r1.39 status.c
--- apps/status.c	13 Feb 2003 21:45:18 -0000	1.39
+++ apps/status.c	19 Feb 2003 20:58:58 -0000
@@ -32,13 +32,16 @@
 #include "icons.h"
 #endif
 #include "powermgmt.h"
+#ifdef HAVE_FMADC
+#include "adc.h"
+#endif
 
 static enum playmode current_mode = STATUS_STOP;
 
-#if defined(HAVE_LCD_CHARCELLS) || defined(HAVE_CHARGE_CTRL)
+#if defined(HAVE_LCD_CHARCELLS) || defined(HAVE_CHARGE_CTRL) || defined (HAVE_FMADC)
 static long switch_tick;
 static int  battery_charge_step = 0;
-#ifdef HAVE_CHARGE_CTRL
+#if defined HAVE_CHARGE_CTRL /* Recorder */ || defined HAVE_FMADC /* FM */
 static bool plug_state;
 static bool battery_state;
 #endif
@@ -200,13 +203,17 @@
 #ifdef HAVE_LCD_BITMAP
     if (global_settings.statusbar) {
         statusbar_wipe();
-#ifdef HAVE_CHARGE_CTRL /* Recorder */
+#if defined HAVE_CHARGE_CTRL /* Recorder */ || defined HAVE_FMADC /* FM */
         if(charger_inserted()) {
             battery_state = true;
             plug_state = true;
+#ifdef HAVE_CHARGE_CTRL /* Recorder */
             if (charge_state > 0) /* charge || top off || trickle */
                 global_settings.runtime = 0;
             if (charge_state == 1) { /* animate battery if charging */
+#else /* FM */
+            if ( ( (adc_read(ADC_EXT_POWER) * EXT_SCALE_FACTOR) / 10000 ) > 350) {
+#endif
                 battlevel = battery_charge_step * 34; /* 34 for a better look */
                 battlevel = battlevel > 100 ? 100 : battlevel;
                 if(TIME_AFTER(current_tick, switch_tick)) {
@@ -228,12 +235,8 @@
                 
         if (battery_state)
             statusbar_icon_battery(battlevel, plug_state);
-#else
-#ifdef HAVE_FMADC /* FM */
-        statusbar_icon_battery(battlevel, charger_inserted());
 #else /* Player */
         statusbar_icon_battery(battlevel, false);
-#endif /* HAVE_FMADC */
 #endif /* HAVE_CHARGE_CTRL */
         statusbar_icon_volume(volume);
         statusbar_icon_play_state(current_mode + Icon_Play);


