diff --git a/code/components/jomjol_helper/Helper.cpp b/code/components/jomjol_helper/Helper.cpp index a137d97dd..d52e8bb5d 100644 --- a/code/components/jomjol_helper/Helper.cpp +++ b/code/components/jomjol_helper/Helper.cpp @@ -837,8 +837,8 @@ bool isSetSystemStatusFlag(SystemStatusFlag_t flag) { } -time_t getUpTime(void) { - return (uint32_t)(esp_timer_get_time()/1000/1000); // in seconds +int getUpTime(void) { + return (int)(esp_timer_get_time()/1000/1000); // in seconds } diff --git a/code/components/jomjol_helper/Helper.h b/code/components/jomjol_helper/Helper.h index 67fcc5c8f..3ee71eba2 100644 --- a/code/components/jomjol_helper/Helper.h +++ b/code/components/jomjol_helper/Helper.h @@ -87,7 +87,7 @@ void clearSystemStatusFlag(SystemStatusFlag_t flag); int getSystemStatus(void); bool isSetSystemStatusFlag(SystemStatusFlag_t flag); -time_t getUpTime(void); +int getUpTime(void); string getResetReason(void); std::string getFormatedUptime(bool compact); diff --git a/code/components/jomjol_mqtt/server_mqtt.cpp b/code/components/jomjol_mqtt/server_mqtt.cpp index a027353d7..a49479146 100644 --- a/code/components/jomjol_mqtt/server_mqtt.cpp +++ b/code/components/jomjol_mqtt/server_mqtt.cpp @@ -182,7 +182,7 @@ void publishSystemData() { LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Publishing system MQTT topics..."); - sprintf(tmp_char, "%ld", (long)getUpTime()); + sprintf(tmp_char, "%d", (int)getUpTime()); MQTTPublish(maintopic + "/" + "uptime", std::string(tmp_char), retainFlag); sprintf(tmp_char, "%lu", (long) getESPHeapSize()); diff --git a/code/components/jomjol_tfliteclass/server_tflite.cpp b/code/components/jomjol_tfliteclass/server_tflite.cpp index 1c798457c..b127f4d37 100644 --- a/code/components/jomjol_tfliteclass/server_tflite.cpp +++ b/code/components/jomjol_tfliteclass/server_tflite.cpp @@ -846,7 +846,7 @@ void task_autodoFlow(void *pvParameter) { LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "----------------------------------------------------------------"); // Clear separation between runs std::string _zw = "Round #" + std::to_string(++countRounds) + " started"; - time_t roundStartTime = getUpTime(); + int roundStartTime = getUpTime(); LogFile.WriteToFile(ESP_LOG_INFO, TAG, _zw); fr_start = esp_timer_get_time();