File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ CMOS::Time& CMOS::Time::hw_update() {
3030 f.day_of_month = get (r_day);
3131 f.month = get (r_month);
3232 f.year = get (r_year);
33- century = get (r_cent);
33+ if (r_cent) century = get (r_cent);
3434 } else {
3535 f.second = bcd_to_binary (get (r_sec));
3636 f.minute = bcd_to_binary (get (r_min));
@@ -39,12 +39,12 @@ CMOS::Time& CMOS::Time::hw_update() {
3939 f.day_of_month = bcd_to_binary (get (r_day));
4040 f.month = bcd_to_binary (get (r_month));
4141 f.year = bcd_to_binary (get (r_year));
42- century = bcd_to_binary (get (r_cent));
42+ if (r_cent) century = bcd_to_binary (get (r_cent));
4343 }
4444
4545 // Insanity
4646 #define CURRENT_YEAR 2017 // Change this each year!
47- if (century != 0 ) {
47+ if (r_cent != 0 ) {
4848 f.year += century * 100 ;
4949 } else {
5050 f.year += (CURRENT_YEAR / 100 ) * 100 ;
You can’t perform that action at this time.
0 commit comments