Add check for initialized state

This commit is contained in:
CommanderRedYT
2022-01-17 11:58:59 +01:00
committed by GitHub
parent 47effe79c7
commit 68fbe968bf

View File

@ -21,9 +21,9 @@ SchedulerTask::SchedulerTask(const char *name, void (&setupCallback)(), void (&l
void SchedulerTask::loop() void SchedulerTask::loop()
{ {
if (m_lastUpdate && espchrono::ago(*m_lastUpdate) < m_loopInterval) if (!m_wasInitialized || (m_lastUpdate && espchrono::ago(*m_lastUpdate) < m_loopInterval))
return; return;
ESP_LOGV(TAG, "start %s", m_name); ESP_LOGV(TAG, "start %s", m_name);
if (m_intervalImportant) if (m_intervalImportant)