Skip to content

Commit

Permalink
change return data type of getUpTime() to an int.
Browse files Browse the repository at this point in the history
Maybe this solves #1658
  • Loading branch information
CaCO3 committed Jan 14, 2023
1 parent 52296b3 commit 06b8bc2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions code/components/jomjol_helper/Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down
2 changes: 1 addition & 1 deletion code/components/jomjol_helper/Helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion code/components/jomjol_mqtt/server_mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion code/components/jomjol_tfliteclass/server_tflite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 06b8bc2

Please sign in to comment.