From 93d22d9ccd59e875f84a52dc6d7e50d3ad7e89d9 Mon Sep 17 00:00:00 2001 From: Adam Pippin Date: Sat, 18 Apr 2020 14:40:25 -0700 Subject: [PATCH] Removing debugging code from Clock --- Clock.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Clock.cpp b/Clock.cpp index e4937c1..ef1eddc 100644 --- a/Clock.cpp +++ b/Clock.cpp @@ -35,8 +35,6 @@ int Clock(int pid, unsigned int signal) EAT_write(2, 4, compile_date.Month); EAT_write(2, 5, compile_date.Date); } - Serial.begin(115200); - delay(30); } if (signal & SIGNAL_STOP) @@ -49,13 +47,13 @@ int Clock(int pid, unsigned int signal) RTC_TimeTypeDef time; M5.Rtc.GetTime(&time); - if (signal & SIGNAL_TICK) // && time.Minutes != last_minute) + if (signal & SIGNAL_TICK && time.Minutes != last_minute) { + last_minute = time.Minutes; Kernel_signal(SIGNAL_REDRAW); } if (signal & SIGNAL_REDRAW) { - Serial.println("Redraw!"); redraw(time); } } @@ -66,8 +64,8 @@ int Clock(int pid, unsigned int signal) void redraw(RTC_TimeTypeDef time) { M5.Lcd.setCursor(0, 40); - char time_str[9]; - sprintf(time_str, "%02d:%02d:%02d", time.Hours, time.Minutes, time.Seconds); + char time_str[6]; + sprintf(time_str, "%02d:%02d", time.Hours, time.Minutes); M5.Lcd.print(time_str); }