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