- sprintf(buffer, "%02d:%02x:%02x", hour, bcd_min, bcd_sec);
+ if (daytime.hour > hour) {
+ daytime.day++;
+ }
+
+ daytime.hour = hour;
+ daytime.min = min;
+ daytime.sec = sec;
+}
+
+char *get_time(void) {
+ static char buffer[9];
+ update_time();
+ sprintf(buffer, "%02d:%02d:%02d", daytime.hour, daytime.min, daytime.sec);