diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/icons.c | 17 | ||||
-rw-r--r-- | apps/status.c | 7 |
2 files changed, 17 insertions, 7 deletions
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 2b37be5e62..3467d2bb3d 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c | |||
@@ -158,17 +158,19 @@ void statusbar_icon_battery(int percent, bool charging) | |||
158 | fill = 100; | 158 | fill = 100; |
159 | 159 | ||
160 | #ifdef SIMULATOR | 160 | #ifdef SIMULATOR |
161 | if (global_settings.battery_type) { | 161 | if (global_settings.battery_type && (percent > -1)) { |
162 | #else | 162 | #else |
163 | #ifdef HAVE_CHARGE_CTRL /* Recorder */ | 163 | #ifdef HAVE_CHARGE_CTRL /* Recorder */ |
164 | /* show graphical animation when charging instead of numbers */ | 164 | /* show graphical animation when charging instead of numbers */ |
165 | if ((global_settings.battery_type) && (charge_state != 1)) { | 165 | if ((global_settings.battery_type) && |
166 | (charge_state != 1) && | ||
167 | (percent > -1)) { | ||
166 | #else /* FM */ | 168 | #else /* FM */ |
167 | if (global_settings.battery_type) { | 169 | if (global_settings.battery_type && (percent > -1)) { |
168 | #endif /* HAVE_CHARGE_CTRL */ | 170 | #endif /* HAVE_CHARGE_CTRL */ |
169 | #endif | 171 | #endif |
170 | /* Numeric display */ | 172 | /* Numeric display */ |
171 | snprintf(buffer, sizeof(buffer), "%3d", percent); | 173 | snprintf(buffer, sizeof(buffer), "%3d", fill); |
172 | lcd_setfont(FONT_SYSFIXED); | 174 | lcd_setfont(FONT_SYSFIXED); |
173 | lcd_getstringsize(buffer, &width, &height); | 175 | lcd_getstringsize(buffer, &width, &height); |
174 | if (height <= STATUSBAR_HEIGHT) | 176 | if (height <= STATUSBAR_HEIGHT) |
@@ -188,6 +190,13 @@ void statusbar_icon_battery(int percent, bool charging) | |||
188 | lcd_fillrect(ICON_BATTERY_X_POS + 1, STATUSBAR_Y_POS + 1, fill, 5); | 190 | lcd_fillrect(ICON_BATTERY_X_POS + 1, STATUSBAR_Y_POS + 1, fill, 5); |
189 | } | 191 | } |
190 | 192 | ||
193 | if (percent == -1) { | ||
194 | lcd_setfont(FONT_SYSFIXED); | ||
195 | lcd_putsxy(ICON_BATTERY_X_POS + ICON_BATTERY_WIDTH / 2 - 4, | ||
196 | STATUSBAR_Y_POS, "?"); | ||
197 | lcd_setfont(FONT_UI); | ||
198 | } | ||
199 | |||
191 | /* draw power plug if charging */ | 200 | /* draw power plug if charging */ |
192 | if (charging) | 201 | if (charging) |
193 | lcd_bitmap(bitmap_icons_7x8[Icon_Plug], ICON_PLUG_X_POS, | 202 | lcd_bitmap(bitmap_icons_7x8[Icon_Plug], ICON_PLUG_X_POS, |
diff --git a/apps/status.c b/apps/status.c index 7e9233a63f..68d6ac74c1 100644 --- a/apps/status.c +++ b/apps/status.c | |||
@@ -40,7 +40,7 @@ static enum playmode current_mode = STATUS_STOP; | |||
40 | static long switch_tick; | 40 | static long switch_tick; |
41 | static int battery_charge_step = 0; | 41 | static int battery_charge_step = 0; |
42 | static bool plug_state; | 42 | static bool plug_state; |
43 | static bool battery_state; | 43 | static bool battery_state = true; |
44 | 44 | ||
45 | struct status_info { | 45 | struct status_info { |
46 | int battlevel; | 46 | int battlevel; |
@@ -167,7 +167,8 @@ void status_draw(bool force_redraw) | |||
167 | battery_state = true; | 167 | battery_state = true; |
168 | else { | 168 | else { |
169 | /* blink battery if level is low */ | 169 | /* blink battery if level is low */ |
170 | if(TIME_AFTER(current_tick, switch_tick)) { | 170 | if(TIME_AFTER(current_tick, switch_tick) && |
171 | (info.battlevel > -1)) { | ||
171 | switch_tick = current_tick+HZ; | 172 | switch_tick = current_tick+HZ; |
172 | battery_state =! battery_state; | 173 | battery_state =! battery_state; |
173 | } | 174 | } |
@@ -175,7 +176,7 @@ void status_draw(bool force_redraw) | |||
175 | } | 176 | } |
176 | 177 | ||
177 | #ifdef HAVE_LCD_BITMAP | 178 | #ifdef HAVE_LCD_BITMAP |
178 | if (battery_state && (info.battlevel > -1)) | 179 | if (battery_state) |
179 | statusbar_icon_battery(info.battlevel, plug_state); | 180 | statusbar_icon_battery(info.battlevel, plug_state); |
180 | 181 | ||
181 | statusbar_icon_volume(info.volume); | 182 | statusbar_icon_volume(info.volume); |