@@ -19,7 +19,7 @@ | |||||
#define VERBOSE_FORMAT(f, msg, ...) LOG_FORMAT(verbose, f, msg, __VA_ARGS__) | #define VERBOSE_FORMAT(f, msg, ...) LOG_FORMAT(verbose, f, msg, __VA_ARGS__) | ||||
#else | #else | ||||
#define DISABLE_LOGGING 1 | |||||
#define DISABLE_LOGGING 1 //TODO : does nothing if not included before ArduinoLog.h | |||||
#define VERBOSE(f) | #define VERBOSE(f) | ||||
#define VERBOSE_MSG(f, msg) | #define VERBOSE_MSG(f, msg) | ||||
@@ -16,7 +16,7 @@ namespace rtc { | |||||
time.Second = RTC.s; | time.Second = RTC.s; | ||||
time.Minute = RTC.m; | time.Minute = RTC.m; | ||||
time.Hour = RTC.h; | time.Hour = RTC.h; | ||||
time.Wday = RTC.dow; | |||||
//time.Wday = RTC.dow; | |||||
time.Day = RTC.dd; | time.Day = RTC.dd; | ||||
time.Month = RTC.mm; | time.Month = RTC.mm; | ||||
time.Year = CalendarYrToTm(RTC.yyyy); | time.Year = CalendarYrToTm(RTC.yyyy); | ||||
@@ -26,7 +26,7 @@ namespace rtc { | |||||
RTC.s = time.Second; | RTC.s = time.Second; | ||||
RTC.m = time.Minute; | RTC.m = time.Minute; | ||||
RTC.h = time.Hour; | RTC.h = time.Hour; | ||||
RTC.dow = time.Wday; | |||||
//RTC.dow = time.Wday; | |||||
RTC.dd = time.Day; | RTC.dd = time.Day; | ||||
RTC.mm = time.Month; | RTC.mm = time.Month; | ||||
RTC.yyyy = tmYearToCalendar(time.Year); | RTC.yyyy = tmYearToCalendar(time.Year); | ||||
@@ -55,7 +55,7 @@ void breakTime(const timestamp_t timeInput, tmElements_t &tm) { | |||||
time /= 60; // now it is hours | time /= 60; // now it is hours | ||||
tm.Hour = time % 24; | tm.Hour = time % 24; | ||||
time /= 24; // now it is days | time /= 24; // now it is days | ||||
tm.Wday = ((time + 4) % 7) + 1; // Sunday is day 1 | |||||
//tm.Wday = ((time + 4) % 7) + 1; // Sunday is day 1 | |||||
year = 0; | year = 0; | ||||
days = 0; | days = 0; | ||||
@@ -16,11 +16,11 @@ typedef struct { | |||||
uint8_t Second; | uint8_t Second; | ||||
uint8_t Minute; | uint8_t Minute; | ||||
uint8_t Hour; | uint8_t Hour; | ||||
uint8_t Wday; // day of week, sunday is day 1 | |||||
//uint8_t Wday; // day of week, sunday is day 1 | |||||
uint8_t Day; | uint8_t Day; | ||||
uint8_t Month; | uint8_t Month; | ||||
uint8_t Year; // offset from 1970; | uint8_t Year; // offset from 1970; | ||||
} tmElements_t, TimeElements, *tmElementsPtr_t; | |||||
} tmElements_t; | |||||
/* low level functions to convert to and from system time */ | /* low level functions to convert to and from system time */ | ||||
void breakTime(const timestamp_t time, tmElements_t &tm); // break timestamp_t into elements | void breakTime(const timestamp_t time, tmElements_t &tm); // break timestamp_t into elements | ||||