fix: account for lateness in RTC scheduler event

This commit is contained in:
2022-09-17 09:07:31 -03:00
parent 12c138364d
commit a2e702c366
2 changed files with 3 additions and 3 deletions

View File

@@ -505,8 +505,8 @@ pub const Clock = struct {
cpu.sched.push(.RealTimeClock, 1 << 24); // Every Second
}
pub fn updateTime(self: *This) void {
self.cpu.sched.push(.RealTimeClock, 1 << 24); // Reschedule
pub fn updateTime(self: *This, late: u64) void {
self.cpu.sched.push(.RealTimeClock, (1 << 24) -| late); // Reschedule
const now = DateTime.now();
self.year = toBcd(u8, @intCast(u8, now.date.year - 2000));