sntp module

This commit is contained in:
2024-12-19 20:33:51 +01:00
parent 0b9f5e2997
commit e5bb620a37
8 changed files with 94 additions and 67 deletions

View File

@ -5,6 +5,7 @@
#include "outputs.h"
#include "inputs.h"
#include "safety.h"
#include "sntp.h"
#define PERIODIC_INTERVAL 1U // run safety checks every 1sec
@ -40,16 +41,20 @@ void taskControl(void *pvParameters)
{
vTaskDelay(PERIODIC_INTERVAL * 1000U / portTICK_PERIOD_MS);
if (getSafetyState() == SAFETY_NO_ERROR)
{
// TODO: control the burner based on timetable
setCirculationPumpState(DISABLED);
setBurnerState(ENABLED);
}
else
if (getSafetyState() != SAFETY_NO_ERROR)
{
ESP_LOGW(TAG, "Control not possible due to safety fault!");
continue;
}
if (getSntpState() != SYNC_SUCCESSFUL)
{
ESP_LOGW(TAG, "Control not possible due to sntp fault!");
continue;
}
// TODO: control the burner based on timetable
setCirculationPumpState(DISABLED);
setBurnerState(ENABLED);
}
}