mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-12 08:26:38 +02:00
implemented #336 set time manually or resync NTP
This commit is contained in:
parent
f53933b473
commit
e3532f4464
7 changed files with 71 additions and 13 deletions
|
@ -61,10 +61,14 @@ void app::loop(void) {
|
|||
}
|
||||
|
||||
if(checkTicker(&mNtpRefreshTicker, mNtpRefreshInterval)) {
|
||||
if(!apActive) {
|
||||
mTimestamp = mWifi->getNtpTime();
|
||||
DPRINTLN(DBG_INFO, "[NTP]: " + getDateTimeStr(mTimestamp));
|
||||
}
|
||||
if(!apActive)
|
||||
mUpdateNtp = true;
|
||||
}
|
||||
|
||||
if(mUpdateNtp) {
|
||||
mUpdateNtp = false;
|
||||
mTimestamp = mWifi->getNtpTime();
|
||||
DPRINTLN(DBG_INFO, "[NTP]: " + getDateTimeStr(mTimestamp));
|
||||
}
|
||||
|
||||
if(mShouldReboot) {
|
||||
|
@ -685,8 +689,9 @@ const char* app::getFieldStateClass(uint8_t fieldId) {
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
void app::resetSystem(void) {
|
||||
mUptimeSecs = 0;
|
||||
mPrevMillis = 0;
|
||||
mUptimeSecs = 0;
|
||||
mPrevMillis = 0;
|
||||
mUpdateNtp = false;
|
||||
|
||||
mNtpRefreshTicker = 0;
|
||||
mNtpRefreshInterval = NTP_REFRESH_INTERVAL; // [ms]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue