Browse Source

Removing debugging code from Clock

master
Adam Pippin 4 years ago
parent
commit
93d22d9ccd
  1. 10
      Clock.cpp

10
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);
}

Loading…
Cancel
Save