mirror of https://github.com/arendst/Tasmota.git
Merge pull request #15094 from netpok/fix/displayclock
Fix display clock
This commit is contained in:
commit
afceec1177
|
@ -980,14 +980,8 @@ void TM1637ShowTime()
|
|||
uint8_t hr = RtcTime.hour;
|
||||
uint8_t mn = RtcTime.minute;
|
||||
uint8_t sc = RtcTime.second;
|
||||
// uint8_t hr = 1;
|
||||
// uint8_t mn = 0;
|
||||
char z = ' ';
|
||||
if (TM1637Data.clock_24)
|
||||
{
|
||||
z = '0';
|
||||
}
|
||||
else
|
||||
|
||||
if (!TM1637Data.clock_24)
|
||||
{
|
||||
if (hr > 12)
|
||||
hr -= 12;
|
||||
|
@ -995,8 +989,13 @@ void TM1637ShowTime()
|
|||
hr = 12;
|
||||
}
|
||||
|
||||
char tm[9];
|
||||
snprintf_P(tm, sizeof(tm), PSTR("%c%d%02d%02d"), z, hr, mn, sc);
|
||||
char tm[7];
|
||||
snprintf_P(tm, sizeof(tm), PSTR("%02d%02d%02d"), hr, mn, sc);
|
||||
|
||||
if (!TM1637Data.clock_24 && tm[0] == '0')
|
||||
{
|
||||
tm[0] = ' ';
|
||||
}
|
||||
|
||||
if (TM1637 == TM1637Data.display_type)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue