Update RTClock.cpp

This commit is contained in:
csnol 2017-08-30 23:28:01 +08:00 committed by GitHub
parent 6e92ddd8bc
commit 6c0be70f2e
1 changed files with 7 additions and 3 deletions

View File

@ -81,12 +81,16 @@
*/
void RTClock::setTime (time_t time_stamp) {
breakTime(time_stamp, tmm); // time will be broken to tm
setTime(tmm);
breakTime(time_stamp, tmm); // time will be broken to tmm
setTime(tmm);
//rtc_set_count(time_stamp);
}
#define LEAP_YEAR(Y) ( ((1970+Y)>0) && !((1970+Y)%4) && ( ((1970+Y)%100) || !((1970+Y)%400) ) )
void RTClock::setTime (time_t time_stamp) {
rtc_set_count(time_stamp);
}
#define LEAP_YEAR(Y) ( ((1970+Y)>0) && !((1970+Y)%4) && ( ((1970+Y)%100) || !((1970+Y)%400) ) )
//-----------------------------------------------------------------------------
void RTClock::breakTime(time_t timeInput, tm_t & tmm)