Skip to content

Commit c1444e5

Browse files
author
jenkie
committed
Show clock instead of runtime if RTC is connected
1 parent 04e3abf commit c1444e5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Arduino_Pedelec_Controller/display.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,17 @@ static void display_nokia_update_graphic()
649649
//print the trip-time in the lower right corner (displayed in the last 5 characters in this line)
650650
lcd.setCursorInPixels(84-5*6,5);
651651
//todo: implement real trip time measurement, including timeouts. Currently it is only the time after the last reset
652+
#ifdef SUPPORT_RTC
653+
if (now.hh<10)
654+
lcd.print(MY_F("0"));
655+
lcd.print(now.hh);
656+
lcd.print(":");
657+
if (now.mm<10)
658+
lcd.print(MY_F("0"));
659+
lcd.print(now.mm);
660+
#else
652661
printTime(millis() / 1000UL); //millis can be used, because they roll over only after 50 days
662+
#endif
653663
}
654664
#endif
655665

0 commit comments

Comments
 (0)