diff options
-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 ******************* | |||
22 | ********************************* | 22 | ********************************* |
23 | 23 | ||
24 | ********************************* | 24 | ********************************* |
25 | VERSION 2.22 * STABLE *********** | ||
26 | ********************************* | ||
27 | Fixed two bugs: | ||
28 | -Digital settings are now independent of LCD settings | ||
29 | -12/24h "Analog" settings are now displayed correctly. | ||
30 | |||
31 | ********************************* | ||
25 | VERSION 2.21 * STABLE *********** | 32 | VERSION 2.21 * STABLE *********** |
26 | ********************************* | 33 | ********************************* |
27 | Changed the behaviour of F2 | 34 | Changed the behaviour of F2 |
@@ -80,12 +87,13 @@ Release Version. | |||
80 | Features analog / digital modes, | 87 | Features analog / digital modes, |
81 | and a few options. | 88 | and 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 */ |
91 | void show_logo(bool animate, bool show_clock_text); | 99 | void 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 | ||