From 066e81b186dcbe0c3cd15362fcb7083e00f6f0d7 Mon Sep 17 00:00:00 2001 From: Phat Nguyen Date: Thu, 9 May 2024 15:03:27 +0700 Subject: [PATCH] fix esp8266 build fail --- src/AgConfigure.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AgConfigure.cpp b/src/AgConfigure.cpp index a03c22f..a78f147 100644 --- a/src/AgConfigure.cpp +++ b/src/AgConfigure.cpp @@ -1186,7 +1186,8 @@ int Configuration::getLastOta(void) { logError("Current year " + String(curYear) + String(" invalid")); return -1; } - time_t lastOta = jconfig[jprop_lastOta]; + double _t = jconfig[jprop_lastOta]; + time_t lastOta = (time_t)_t; time_t curTime = mktime(&timeInfo); logInfo("Last ota time: " + String(lastOta)); if (lastOta == 0) { @@ -1211,7 +1212,7 @@ void Configuration::updateLastOta(void) { } time_t lastOta = mktime(&timeInfo); - jconfig[jprop_lastOta] = lastOta; + jconfig[jprop_lastOta] = (unsigned long)lastOta; logInfo("Last OTA: " + String(lastOta)); saveConfig(); }