add control status
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
#define PERIODIC_INTERVAL 1U // run safety checks every 1sec
|
||||
|
||||
static const char *TAG = "smart-oil-heater-control-system-control";
|
||||
|
||||
static eControlState sControlState = CONTROL_STARTING;
|
||||
void taskControl(void *pvParameters);
|
||||
|
||||
void initControl(void)
|
||||
@ -44,12 +44,14 @@ void taskControl(void *pvParameters)
|
||||
if (getSafetyState() != SAFETY_NO_ERROR)
|
||||
{
|
||||
ESP_LOGW(TAG, "Control not possible due to safety fault!");
|
||||
sControlState = CONTROL_FAULT;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (getSntpState() != SYNC_SUCCESSFUL)
|
||||
{
|
||||
ESP_LOGW(TAG, "Control not possible due to sntp fault!");
|
||||
sControlState = CONTROL_FAULT;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -58,4 +60,9 @@ void taskControl(void *pvParameters)
|
||||
setBurnerState(ENABLED);
|
||||
setSafetyControlState(ENABLED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
eControlState getControlState(void)
|
||||
{
|
||||
return sControlState;
|
||||
}
|
||||
|
Reference in New Issue
Block a user