From 3d5114d04b37bf53c40c6d6157179c05fc88255f Mon Sep 17 00:00:00 2001 From: pieterbl Date: Tue, 11 Feb 2020 23:09:38 +0100 Subject: [PATCH] Fixed typos in TimeLib.h and Time.cpp Change-Id: Ia05c370e8f09b75dddf11cf2aa8b5de4c21bd45d --- Time.cpp | 6 +++--- TimeLib.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Time.cpp b/Time.cpp index 8e53e56..0dcb29f 100644 --- a/Time.cpp +++ b/Time.cpp @@ -141,9 +141,9 @@ int year(time_t t) { // the year for the given time /*============================================================================*/ /* functions to convert to and from system time */ -/* These are for interfacing with time serivces and are not normally needed in a sketch */ +/* These are for interfacing with time services and are not normally needed in a sketch */ -// leap year calulator expects year argument as years offset from 1970 +// leap year calculator expects year argument as years offset from 1970 #define LEAP_YEAR(Y) ( ((1970+(Y))>0) && !((1970+(Y))%4) && ( ((1970+(Y))%100) || !((1970+(Y))%400) ) ) static const uint8_t monthDays[]={31,28,31,30,31,30,31,31,30,31,30,31}; // API starts months from 1, this array starts from 0 @@ -213,7 +213,7 @@ time_t makeTime(const tmElements_t &tm){ seconds= tm.Year*(SECS_PER_DAY * 365); for (i = 0; i < tm.Year; i++) { if (LEAP_YEAR(i)) { - seconds += SECS_PER_DAY; // add extra days for leap years + seconds += SECS_PER_DAY; // add extra days for leap years } } diff --git a/TimeLib.h b/TimeLib.h index 20e2445..b587046 100644 --- a/TimeLib.h +++ b/TimeLib.h @@ -80,7 +80,7 @@ typedef time_t(*getExternalTime)(); #define elapsedDays(_time_) ((_time_) / SECS_PER_DAY) // this is number of days since Jan 1 1970 #define elapsedSecsToday(_time_) ((_time_) % SECS_PER_DAY) // the number of seconds since last midnight // The following macros are used in calculating alarms and assume the clock is set to a date later than Jan 1 1971 -// Always set the correct time before settting alarms +// Always set the correct time before setting alarms #define previousMidnight(_time_) (((_time_) / SECS_PER_DAY) * SECS_PER_DAY) // time at the start of the given day #define nextMidnight(_time_) (previousMidnight(_time_) + SECS_PER_DAY) // time at the end of the given day #define elapsedSecsThisWeek(_time_) (elapsedSecsToday(_time_) + ((dayOfWeek(_time_)-1) * SECS_PER_DAY)) // note that week starts on day 1 -- GitLab