diff options
author | Zakk Roberts <midk@rockbox.org> | 2004-07-17 00:33:46 +0000 |
---|---|---|
committer | Zakk Roberts <midk@rockbox.org> | 2004-07-17 00:33:46 +0000 |
commit | 2278b14c3ef5479726cd7add19b6cac6fedb0b4e (patch) | |
tree | 8b4c2e1bbd897311774ce1a575c19cbf8c7d382d | |
parent | 285084df44564068c54a7c0997af4d60fabe1376 (diff) |
Analog time display bugfix and digital/lcd 12h settings seperated
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4891 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/clock.c | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/apps/plugins/clock.c b/apps/plugins/clock.c index 8e392e9a81..7cf335f0e1 100644 --- a/apps/plugins/clock.c +++ b/apps/plugins/clock.c @@ -22,6 +22,13 @@ RELEASE NOTES ******************* ********************************* ********************************* +VERSION 2.22 * STABLE *********** +********************************* +Fixed two bugs: +-Digital settings are now independent of LCD settings +-12/24h "Analog" settings are now displayed correctly. + +********************************* VERSION 2.21 * STABLE *********** ********************************* Changed the behaviour of F2 @@ -80,12 +87,13 @@ Release Version. Features analog / digital modes, and a few options. ********************************/ + #include "plugin.h" #include "time.h" #ifdef HAVE_LCD_BITMAP -#define CLOCK_VERSION "2.21" +#define CLOCK_VERSION "2.22" /* prototypes */ void show_logo(bool animate, bool show_clock_text); @@ -758,18 +766,40 @@ bool colon, bool lcd) int xpos = x; /* Draw PM indicator */ - if(settings.digital_12h) + if(settings.clock == 2) + { + if(settings.digital_12h) + { + if(hour > 12) + rb->lcd_bitmap(pm, 97, 55, 15, 8, true); + else + rb->lcd_bitmap(am, 1, 55, 15, 8, true); + } + } + else { - if(hour > 12) - rb->lcd_bitmap(pm, 97, 55, 15, 8, true); - else - rb->lcd_bitmap(am, 1, 55, 15, 8, true); - } + if(settings.lcd_12h) + { + if(hour > 12) + rb->lcd_bitmap(pm, 97, 55, 15, 8, true); + else + rb->lcd_bitmap(am, 1, 55, 15, 8, true); + } + } /* Now change to 12H mode if requested */ - if(settings.digital_12h) - if(hour > 12) - hour -= 12; + if(settings.clock == 2) + { + if(settings.digital_12h) + if(hour > 12) + hour -= 12; + } + else + { + if(settings.lcd_12h) + if(hour > 12) + hour -= 12; + } draw_7seg_digit(hour / 10, xpos, y, width, height, lcd); xpos += width + 6; @@ -2105,8 +2135,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) hour = current_time->tm_hour; minute = current_time->tm_min; second = current_time->tm_sec; - - temphour = hour; + temphour = current_time->tm_hour; /********************* * Date info @@ -2300,8 +2329,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) } } - if(settings.analog_time == 1 && temphour > 12) - temphour += 12; + if(settings.analog_time == 2 && temphour > 12) + temphour -= 12; draw_extras(year, day, month, temphour, minute, second); |