sntp module
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user