summaryrefslogtreecommitdiff
path: root/apps/plugins/clock.c
diff options
context:
space:
mode:
authorZakk Roberts <midk@rockbox.org>2004-07-17 00:33:46 +0000
committerZakk Roberts <midk@rockbox.org>2004-07-17 00:33:46 +0000
commit2278b14c3ef5479726cd7add19b6cac6fedb0b4e (patch)
tree8b4c2e1bbd897311774ce1a575c19cbf8c7d382d /apps/plugins/clock.c
parent285084df44564068c54a7c0997af4d60fabe1376 (diff)
downloadrockbox-2278b14c3ef5479726cd7add19b6cac6fedb0b4e.tar.gz
rockbox-2278b14c3ef5479726cd7add19b6cac6fedb0b4e.zip
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
Diffstat (limited to 'apps/plugins/clock.c')
-rw-r--r--apps/plugins/clock.c57
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 *******************
22********************************* 22*********************************
23 23
24********************************* 24*********************************
25VERSION 2.22 * STABLE ***********
26*********************************
27Fixed two bugs:
28-Digital settings are now independent of LCD settings
29-12/24h "Analog" settings are now displayed correctly.
30
31*********************************
25VERSION 2.21 * STABLE *********** 32VERSION 2.21 * STABLE ***********
26********************************* 33*********************************
27Changed the behaviour of F2 34Changed the behaviour of F2
@@ -80,12 +87,13 @@ Release Version.
80Features analog / digital modes, 87Features analog / digital modes,
81and a few options. 88and a few options.
82********************************/ 89********************************/
90
83#include "plugin.h" 91#include "plugin.h"
84#include "time.h" 92#include "time.h"
85 93
86#ifdef HAVE_LCD_BITMAP 94#ifdef HAVE_LCD_BITMAP
87 95
88#define CLOCK_VERSION "2.21" 96#define CLOCK_VERSION "2.22"
89 97
90/* prototypes */ 98/* prototypes */
91void show_logo(bool animate, bool show_clock_text); 99void show_logo(bool animate, bool show_clock_text);
@@ -758,18 +766,40 @@ bool colon, bool lcd)
758 int xpos = x; 766 int xpos = x;
759 767
760 /* Draw PM indicator */ 768 /* Draw PM indicator */
761 if(settings.digital_12h) 769 if(settings.clock == 2)
770 {
771 if(settings.digital_12h)
772 {
773 if(hour > 12)
774 rb->lcd_bitmap(pm, 97, 55, 15, 8, true);
775 else
776 rb->lcd_bitmap(am, 1, 55, 15, 8, true);
777 }
778 }
779 else
762 { 780 {
763 if(hour > 12) 781 if(settings.lcd_12h)
764 rb->lcd_bitmap(pm, 97, 55, 15, 8, true); 782 {
765 else 783 if(hour > 12)
766 rb->lcd_bitmap(am, 1, 55, 15, 8, true); 784 rb->lcd_bitmap(pm, 97, 55, 15, 8, true);
767 } 785 else
786 rb->lcd_bitmap(am, 1, 55, 15, 8, true);
787 }
788 }
768 789
769 /* Now change to 12H mode if requested */ 790 /* Now change to 12H mode if requested */
770 if(settings.digital_12h) 791 if(settings.clock == 2)
771 if(hour > 12) 792 {
772 hour -= 12; 793 if(settings.digital_12h)
794 if(hour > 12)
795 hour -= 12;
796 }
797 else
798 {
799 if(settings.lcd_12h)
800 if(hour > 12)
801 hour -= 12;
802 }
773 803
774 draw_7seg_digit(hour / 10, xpos, y, width, height, lcd); 804 draw_7seg_digit(hour / 10, xpos, y, width, height, lcd);
775 xpos += width + 6; 805 xpos += width + 6;
@@ -2105,8 +2135,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
2105 hour = current_time->tm_hour; 2135 hour = current_time->tm_hour;
2106 minute = current_time->tm_min; 2136 minute = current_time->tm_min;
2107 second = current_time->tm_sec; 2137 second = current_time->tm_sec;
2108 2138 temphour = current_time->tm_hour;
2109 temphour = hour;
2110 2139
2111 /********************* 2140 /*********************
2112 * Date info 2141 * Date info
@@ -2300,8 +2329,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
2300 } 2329 }
2301 } 2330 }
2302 2331
2303 if(settings.analog_time == 1 && temphour > 12) 2332 if(settings.analog_time == 2 && temphour > 12)
2304 temphour += 12; 2333 temphour -= 12;
2305 2334
2306 draw_extras(year, day, month, temphour, minute, second); 2335 draw_extras(year, day, month, temphour, minute, second);
2307 2336