From 31fcdba7c0ec5bc1105ae61412b7824eadec1acc Mon Sep 17 00:00:00 2001 From: Bertrand Lemasle Date: Tue, 13 Mar 2018 13:22:05 +1300 Subject: [PATCH] Adapted code to uDS3231 code trim --- GpsTracker/Debug.h | 2 +- GpsTracker/Rtc.cpp | 4 ++-- GpsTracker/Time2.cpp | 2 +- GpsTracker/Time2.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GpsTracker/Debug.h b/GpsTracker/Debug.h index 875593e..624d99f 100644 --- a/GpsTracker/Debug.h +++ b/GpsTracker/Debug.h @@ -19,7 +19,7 @@ #define VERBOSE_FORMAT(f, msg, ...) LOG_FORMAT(verbose, f, msg, __VA_ARGS__) #else -#define DISABLE_LOGGING 1 +#define DISABLE_LOGGING 1 //TODO : does nothing if not included before ArduinoLog.h #define VERBOSE(f) #define VERBOSE_MSG(f, msg) diff --git a/GpsTracker/Rtc.cpp b/GpsTracker/Rtc.cpp index 8a2b4ab..c7705bc 100644 --- a/GpsTracker/Rtc.cpp +++ b/GpsTracker/Rtc.cpp @@ -16,7 +16,7 @@ namespace rtc { time.Second = RTC.s; time.Minute = RTC.m; time.Hour = RTC.h; - time.Wday = RTC.dow; + //time.Wday = RTC.dow; time.Day = RTC.dd; time.Month = RTC.mm; time.Year = CalendarYrToTm(RTC.yyyy); @@ -26,7 +26,7 @@ namespace rtc { RTC.s = time.Second; RTC.m = time.Minute; RTC.h = time.Hour; - RTC.dow = time.Wday; + //RTC.dow = time.Wday; RTC.dd = time.Day; RTC.mm = time.Month; RTC.yyyy = tmYearToCalendar(time.Year); diff --git a/GpsTracker/Time2.cpp b/GpsTracker/Time2.cpp index 2bee65c..49c7225 100644 --- a/GpsTracker/Time2.cpp +++ b/GpsTracker/Time2.cpp @@ -55,7 +55,7 @@ void breakTime(const timestamp_t timeInput, tmElements_t &tm) { time /= 60; // now it is hours tm.Hour = time % 24; 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; days = 0; diff --git a/GpsTracker/Time2.h b/GpsTracker/Time2.h index b21a4e2..bba52fa 100644 --- a/GpsTracker/Time2.h +++ b/GpsTracker/Time2.h @@ -16,11 +16,11 @@ typedef struct { uint8_t Second; uint8_t Minute; 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 Month; uint8_t Year; // offset from 1970; -} tmElements_t, TimeElements, *tmElementsPtr_t; +} tmElements_t; /* low level functions to convert to and from system time */ void breakTime(const timestamp_t time, tmElements_t &tm); // break timestamp_t into elements