summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/icons.c28
-rw-r--r--apps/recorder/icons.h2
2 files changed, 20 insertions, 10 deletions
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c
index d1ee11dbed..3f6518903f 100644
--- a/apps/recorder/icons.c
+++ b/apps/recorder/icons.c
@@ -290,23 +290,33 @@ void statusbar_icon_lock(void)
290/* 290/*
291 * Print time to status bar 291 * Print time to status bar
292 */ 292 */
293void statusbar_time(void) 293void statusbar_time(int minutes)
294{ 294{
295 int hour,minute;
296 unsigned char buffer[6]; 295 unsigned char buffer[6];
297 unsigned int width, height; 296 unsigned int width, height;
298#if defined(LOADABLE_FONTS) 297#if defined(LOADABLE_FONTS)
299 unsigned char *font; 298 unsigned char *font;
300#endif 299#endif
301 300
302 hour = rtc_read(0x03); 301 int hour = minutes / 60;
303 minute = rtc_read(0x02); 302 int minute = minutes % 60;
303
304 if ( hour >= 0 &&
305 hour <= 23 &&
306 minute >= 0 &&
307 minute <= 59 )
308 {
309 snprintf(buffer, sizeof(buffer), "%d%d:%d%d",
310 (hour & 0x30) >> 4,
311 hour & 0x0f,
312 (minute & 0xf0) >> 4,
313 minute & 0x0f);
314 }
315 else
316 {
317 strncpy(buffer, "--:--", sizeof buffer);
318 }
304 319
305 snprintf(buffer, sizeof(buffer), "%d%d:%d%d",
306 (hour & 0x30) >> 4,
307 hour & 0x0f,
308 (minute & 0xf0) >> 4,
309 minute & 0x0f);
310#if defined(LCD_PROPFONTS) 320#if defined(LCD_PROPFONTS)
311 lcd_getstringsize(buffer, 0, &width, &height); 321 lcd_getstringsize(buffer, 0, &width, &height);
312#elif defined(LOADABLE_FONTS) 322#elif defined(LOADABLE_FONTS)
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h
index ff6a011b98..cebff7ca2c 100644
--- a/apps/recorder/icons.h
+++ b/apps/recorder/icons.h
@@ -86,6 +86,6 @@ extern void statusbar_icon_play_mode(int mode);
86extern void statusbar_icon_shuffle(void); 86extern void statusbar_icon_shuffle(void);
87extern void statusbar_icon_lock(void); 87extern void statusbar_icon_lock(void);
88#ifdef HAVE_RTC 88#ifdef HAVE_RTC
89extern void statusbar_time(void); 89extern void statusbar_time(int minutes);
90#endif 90#endif
91#endif /* End HAVE_LCD_BITMAP */ 91#endif /* End HAVE_LCD_BITMAP */