Missing mutex protection
This commit is contained in:
@ -55,7 +55,17 @@ void initOutputs(void)
|
|||||||
|
|
||||||
eOutput getCirculationPumpState(void)
|
eOutput getCirculationPumpState(void)
|
||||||
{
|
{
|
||||||
return sCirculationPumpState;
|
eOutput ret = ENABLED;
|
||||||
|
if (xSemaphoreTakeRecursive(xMutexAccessOutputs, pdMS_TO_TICKS(5000)) == pdTRUE)
|
||||||
|
{
|
||||||
|
ret = sCirculationPumpState;
|
||||||
|
xSemaphoreGiveRecursive(xMutexAccessOutputs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ESP_LOGE(TAG, "Unable to take mutex: getCirculationPumpState()");
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCirculationPumpState(eOutput in)
|
void setCirculationPumpState(eOutput in)
|
||||||
|
|||||||
Reference in New Issue
Block a user