From 33e5a20b419799ae0b52abd29eedf72188259f77 Mon Sep 17 00:00:00 2001 From: James Myatt Date: Wed, 28 Feb 2018 16:54:54 +0000 Subject: [PATCH] Bug fix --- Time.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Time.cpp b/Time.cpp index cc1d97b..fd07a57 100644 --- a/Time.cpp +++ b/Time.cpp @@ -33,6 +33,7 @@ #include #endif +#define TIMELIB_ENABLE_MILLIS #include "TimeLib.h" static tmElements_t tm; // a cache of time elements @@ -253,6 +254,11 @@ time_t sysUnsyncedTime = 0; // the time sysTime unadjusted by sync #endif +time_t now() { + uint32_t sysTimeMillis; + return now(sysTimeMillis); +} + time_t now(uint32_t& sysTimeMillis) { // calculate number of seconds passed since last call to now() while ((sysTimeMillis = millis() - prevMillis) >= 1000) { @@ -279,11 +285,6 @@ time_t now(uint32_t& sysTimeMillis) { return (time_t)sysTime; } -time_t now() { - uint32_t sysTimeMillis; - return now(sysTimeMillis); -} - void setTime(time_t t) { #ifdef TIME_DRIFT_INFO if(sysUnsyncedTime == 0)