From cc11e885d1ab32f11b322071260376de3788c62e Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Mon, 27 Jan 2003 14:24:40 +0000 Subject: Corrected get_time(). This should fix the bad file date bug. Also changed status.c to use get_time() instead of reading directly from RTC. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3170 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/recording.c | 2 +- apps/status.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'apps') diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 73b2773e44..adcea752d4 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -143,7 +143,7 @@ static char *create_filename(void) /* Create a filename: RYYMMDDHHMMSS.mp3 */ snprintf(fname, 32, "/R%02d%02d%02d%02d%02d%02d.mp3", - tm->tm_year-2000, tm->tm_mon, tm->tm_mday, + tm->tm_year%100, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); DEBUGF("Filename: %s\n", fname); diff --git a/apps/status.c b/apps/status.c index 3921a3bcdb..8ebf662ad8 100644 --- a/apps/status.c +++ b/apps/status.c @@ -26,7 +26,7 @@ #include "mpeg.h" #include "wps.h" #ifdef HAVE_RTC -#include "rtc.h" +#include "timefuncs.h" #endif #ifdef HAVE_LCD_BITMAP #include "icons.h" @@ -88,7 +88,7 @@ void status_draw(void) int battlevel = battery_level(); int volume = mpeg_val2phys(SOUND_VOLUME, global_settings.volume); #if defined(HAVE_LCD_BITMAP) && defined(HAVE_RTC) - int hour, minute; + struct tm* tm; #endif if ( !global_settings.statusbar ) @@ -247,11 +247,8 @@ void status_draw(void) if (keys_locked) statusbar_icon_lock(); #ifdef HAVE_RTC - hour = rtc_read(3); - hour = ((hour & 0x30) >> 4) * 10 + (hour & 0x0f); - minute = rtc_read(2); - minute = ((minute & 0x70) >> 4) * 10 + (minute & 0x0f); - statusbar_time(hour, minute); + tm = get_time(); + statusbar_time(tm->tm_hour, tm->tm_min); #endif lcd_update_rect(0, 0, LCD_WIDTH, STATUSBAR_HEIGHT); -- cgit v1.2.3