Add flag for checking if task was initialized #1

Open
CommanderRedYT wants to merge 2 commits from CommanderRedYT/patch-1 into main
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 68fbe968bf - Show all commits

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)