diff --git a/tasmota/xdsp_15_tm1637.ino b/tasmota/xdsp_15_tm1637.ino index 05b269e9e..f0497f901 100644 --- a/tasmota/xdsp_15_tm1637.ino +++ b/tasmota/xdsp_15_tm1637.ino @@ -979,6 +979,7 @@ 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 = ' '; @@ -994,22 +995,9 @@ void TM1637ShowTime() hr = 12; } - char tm[5]; - if (hr < 10) - { - if (mn < 10) - snprintf(tm, sizeof(tm), PSTR("%c%d0%d"), z, hr, mn); - else - snprintf(tm, sizeof(tm), PSTR("%c%d%d"), z, hr, mn); - } - else - { - if (mn < 10) - snprintf(tm, sizeof(tm), PSTR("%d0%d"), hr, mn); - else - snprintf(tm, sizeof(tm), PSTR("%d%d"), hr, mn); - } - + char tm[9]; + snprintf_P(tm, sizeof(tm), PSTR("%c%d%02d%02d"), z, hr, mn, sc); + if (TM1637 == TM1637Data.display_type) { uint8_t rawBytes[1]; @@ -1035,7 +1023,8 @@ void TM1637ShowTime() { for (uint32_t i = 0; i < 4; i++) { - if ((millis() % 1000) > 500 && (i == 1)) + //if ((millis() % 1000) > 500 && (i == 3)) + if ((i == 1) || (i == 3)) displayMAX7219ASCIIwDot(i, tm[i]); else displayMAX7219ASCII(i, tm[i]);