Browse Source

Adapted code to uDS3231 code trim

tags/v1.2.0
Bertrand Lemasle 7 years ago
parent
commit
31fcdba7c0
4 changed files with 6 additions and 6 deletions
  1. +1
    -1
      GpsTracker/Debug.h
  2. +2
    -2
      GpsTracker/Rtc.cpp
  3. +1
    -1
      GpsTracker/Time2.cpp
  4. +2
    -2
      GpsTracker/Time2.h

+ 1
- 1
GpsTracker/Debug.h View File

@@ -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)


+ 2
- 2
GpsTracker/Rtc.cpp View File

@@ -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);


+ 1
- 1
GpsTracker/Time2.cpp View File

@@ -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;


+ 2
- 2
GpsTracker/Time2.h View File

@@ -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


Loading…
Cancel
Save