Fix for NTP update time. Minor refactoring.

This commit is contained in:
2024-04-04 21:37:57 +02:00
parent 73b390d8cd
commit eb4341e05b
3 changed files with 8 additions and 8 deletions

View File

@@ -251,9 +251,6 @@ void loop()
if ((current_time_us - last_heartbeat_us) >= PERIOD_HEARTBEAT_US)
{
send_heartbeat(); // send heartbeat update
tm_mgr.log_time(); // TODO rm
last_heartbeat_us = system_get_time();
delay(10);
}
@@ -283,7 +280,10 @@ void loop()
if ((current_time_us - last_time_update_us) >= PERIOD_TIME_UPDATE_US)
{
tm_mgr.ntp_time_update(); // NTP time update
if (tm_mgr.ntp_time_update() == NTP_UPDATE_OK) // NTP time update
{
logger.log_string("NTP sync successful!");
}
if (tm_mgr.ntp_update_failed_prolonged() == true)
{