Can someone take a look at this page:
http://wiki.osdev.org/CMOSgo down to the C code example with the heading "Reading All RTC Time and Date Registers". Now look at the do-while loop which contains the comment "This uses the "read registers until you get the same values twice in a row". Is the condition in the do-while loop not wrong? instead of
Code:
} while( (last_second == second) && (last_minute == minute) && (last_hour == hour) &&
(last_day == day) && (last_month == month) && (last_year == year) &&
(last_century == century) );
would you not want its negation:
Code:
} while( ! (last_second == second) && (last_minute == minute) && (last_hour == hour) &&
(last_day == day) && (last_month == month) && (last_year == year) &&
(last_century == century) );