mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-10 07:26:38 +02:00
fix #209
This commit is contained in:
parent
2bfb6467e0
commit
b67cd033d2
2 changed files with 9 additions and 10 deletions
|
@ -53,14 +53,11 @@ void app::loop(void) {
|
|||
mWebInst->loop();
|
||||
|
||||
if(checkTicker(&mUptimeTicker, mUptimeInterval)) {
|
||||
mUptimeSecs++;
|
||||
if(0 != mTimestamp)
|
||||
mTimestamp++;
|
||||
else {
|
||||
if(!apActive) {
|
||||
mTimestamp = mWifi->getNtpTime();
|
||||
DPRINTLN(DBG_INFO, "[NTP]: " + getDateTimeStr(mTimestamp));
|
||||
}
|
||||
if(millis() - mPrevMillis >= 1000) {
|
||||
mPrevMillis += 1000;
|
||||
mUptimeSecs++;
|
||||
if(0 != mTimestamp)
|
||||
mTimestamp++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -662,9 +659,10 @@ const char* app::getFieldStateClass(uint8_t fieldId) {
|
|||
void app::resetSystem(void) {
|
||||
mUptimeSecs = 0;
|
||||
mUptimeTicker = 0xffffffff;
|
||||
mUptimeInterval = 1000; // [ms]
|
||||
mUptimeInterval = 500; // [ms]
|
||||
mPrevMillis = 0;
|
||||
|
||||
mNtpRefreshTicker = 0xffffffff;
|
||||
mNtpRefreshTicker = 0;
|
||||
mNtpRefreshInterval = NTP_REFRESH_INTERVAL; // [ms]
|
||||
|
||||
#ifdef AP_ONLY
|
||||
|
|
|
@ -224,6 +224,7 @@ class app {
|
|||
uint32_t mUptimeTicker;
|
||||
uint16_t mUptimeInterval;
|
||||
uint32_t mUptimeSecs;
|
||||
uint32_t mPrevMillis;
|
||||
uint8_t mHeapStatCnt;
|
||||
uint32_t mNtpRefreshTicker;
|
||||
uint32_t mNtpRefreshInterval;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue