Skip to content

Commit 6c0be70

Browse files
authored
Update RTClock.cpp
1 parent 6e92ddd commit 6c0be70

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

STM32F1/libraries/RTClock/src/RTClock.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,16 @@
8181
*/
8282

8383
void RTClock::setTime (time_t time_stamp) {
84-
breakTime(time_stamp, tmm); // time will be broken to tm
85-
setTime(tmm);
84+
breakTime(time_stamp, tmm); // time will be broken to tmm
85+
setTime(tmm);
8686
//rtc_set_count(time_stamp);
8787
}
8888

89-
#define LEAP_YEAR(Y) ( ((1970+Y)>0) && !((1970+Y)%4) && ( ((1970+Y)%100) || !((1970+Y)%400) ) )
89+
void RTClock::setTime (time_t time_stamp) {
90+
rtc_set_count(time_stamp);
91+
}
92+
93+
#define LEAP_YEAR(Y) ( ((1970+Y)>0) && !((1970+Y)%4) && ( ((1970+Y)%100) || !((1970+Y)%400) ) )
9094

9195
//-----------------------------------------------------------------------------
9296
void RTClock::breakTime(time_t timeInput, tm_t & tmm)

0 commit comments

Comments
 (0)