Version 1.2.1.
This commit is contained in:
parent
1806aa333a
commit
ee7299fb4e
@ -71,6 +71,7 @@ RTC_DATA_ATTR struct TimeData {
|
|||||||
String LastYear;
|
String LastYear;
|
||||||
unsigned long EPSMS; // Milliseconds (rounded to the enxt minute) when the clock was updated via NTP.
|
unsigned long EPSMS; // Milliseconds (rounded to the enxt minute) when the clock was updated via NTP.
|
||||||
bool NewMinute; // Set to True when New Minute happens.
|
bool NewMinute; // Set to True when New Minute happens.
|
||||||
|
time_t TravelTest; // For Travel Testing.
|
||||||
} WatchTime;
|
} WatchTime;
|
||||||
|
|
||||||
RTC_DATA_ATTR struct Countdown {
|
RTC_DATA_ATTR struct Countdown {
|
||||||
@ -2076,19 +2077,18 @@ void WatchyGSR::UpdateClock(){
|
|||||||
|
|
||||||
// Manage time will determine if the RTC is in use, will also set a flag to "New Minute" for the loop functions to see the minute change.
|
// Manage time will determine if the RTC is in use, will also set a flag to "New Minute" for the loop functions to see the minute change.
|
||||||
void WatchyGSR::ManageTime(){
|
void WatchyGSR::ManageTime(){
|
||||||
tmElements_t TM;
|
tmElements_t TM; // struct tm * tm;
|
||||||
time_t TT;
|
|
||||||
int I;
|
int I;
|
||||||
if (WatchTime.EPSMS < millis()){
|
if (WatchTime.EPSMS < millis()){
|
||||||
// Deal with NTPData.TimeTest.
|
// Deal with NTPData.TimeTest.
|
||||||
if (NTPData.TimeTest){
|
if (NTPData.TimeTest){
|
||||||
TT = WatchTime.UTC_RAW + 60; // Add the minute.
|
|
||||||
UpdateUTC();
|
|
||||||
NTPData.TestCount++;
|
NTPData.TestCount++;
|
||||||
|
UpdateUTC();
|
||||||
|
if (NTPData.TestCount == 1) WatchTime.TravelTest = WatchTime.UTC_RAW + 60; // Add the minute.
|
||||||
if (NTPData.TestCount > 1){
|
if (NTPData.TestCount > 1){
|
||||||
I = Options.Drift;
|
I = Options.Drift;
|
||||||
if (NTPData.NTPDone){
|
if (NTPData.NTPDone){
|
||||||
Options.Drift = (TT - WatchTime.UTC_RAW);
|
Options.Drift = (WatchTime.TravelTest - WatchTime.UTC_RAW);
|
||||||
Options.UsingDrift = (Options.Drift != 0);
|
Options.UsingDrift = (Options.Drift != 0);
|
||||||
if (Menu.Item == MENU_TOFF) Menu.SubItem = 3;
|
if (Menu.Item == MENU_TOFF) Menu.SubItem = 3;
|
||||||
NTPData.TimeTest = false;
|
NTPData.TimeTest = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user