mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-26 23:36:37 -04:00
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
This commit is contained in:
parent
285084df44
commit
2278b14c3e
1 changed files with 43 additions and 14 deletions
|
|
@ -21,6 +21,13 @@
|
||||||
RELEASE NOTES *******************
|
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 ***********
|
VERSION 2.21 * STABLE ***********
|
||||||
*********************************
|
*********************************
|
||||||
|
|
@ -80,12 +87,13 @@ Release Version.
|
||||||
Features analog / digital modes,
|
Features analog / digital modes,
|
||||||
and a few options.
|
and a few options.
|
||||||
********************************/
|
********************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
||||||
#define CLOCK_VERSION "2.21"
|
#define CLOCK_VERSION "2.22"
|
||||||
|
|
||||||
/* prototypes */
|
/* prototypes */
|
||||||
void show_logo(bool animate, bool show_clock_text);
|
void show_logo(bool animate, bool show_clock_text);
|
||||||
|
|
@ -758,18 +766,40 @@ bool colon, bool lcd)
|
||||||
int xpos = x;
|
int xpos = x;
|
||||||
|
|
||||||
/* Draw PM indicator */
|
/* 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)
|
if(settings.lcd_12h)
|
||||||
rb->lcd_bitmap(pm, 97, 55, 15, 8, true);
|
{
|
||||||
else
|
if(hour > 12)
|
||||||
rb->lcd_bitmap(am, 1, 55, 15, 8, true);
|
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 */
|
/* Now change to 12H mode if requested */
|
||||||
if(settings.digital_12h)
|
if(settings.clock == 2)
|
||||||
if(hour > 12)
|
{
|
||||||
hour -= 12;
|
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);
|
draw_7seg_digit(hour / 10, xpos, y, width, height, lcd);
|
||||||
xpos += width + 6;
|
xpos += width + 6;
|
||||||
|
|
@ -2105,8 +2135,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
hour = current_time->tm_hour;
|
hour = current_time->tm_hour;
|
||||||
minute = current_time->tm_min;
|
minute = current_time->tm_min;
|
||||||
second = current_time->tm_sec;
|
second = current_time->tm_sec;
|
||||||
|
temphour = current_time->tm_hour;
|
||||||
temphour = hour;
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* Date info
|
* Date info
|
||||||
|
|
@ -2300,8 +2329,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(settings.analog_time == 1 && temphour > 12)
|
if(settings.analog_time == 2 && temphour > 12)
|
||||||
temphour += 12;
|
temphour -= 12;
|
||||||
|
|
||||||
draw_extras(year, day, month, temphour, minute, second);
|
draw_extras(year, day, month, temphour, minute, second);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue