read 1-Wire again if error occurred
This commit is contained in:
parent
03fe849fec
commit
1fb4b4b0e4
@ -7,6 +7,7 @@
|
|||||||
#include "inputs.h"
|
#include "inputs.h"
|
||||||
|
|
||||||
#define MAX_DN18B20_SENSORS 4U
|
#define MAX_DN18B20_SENSORS 4U
|
||||||
|
#define ONE_WIRE_LOOPS 2U // try to read the 1-Wire sensors that often
|
||||||
#define PERIODIC_INTERVAL 1U // read and compute the inputs every 1sec
|
#define PERIODIC_INTERVAL 1U // read and compute the inputs every 1sec
|
||||||
|
|
||||||
static const char *TAG = "smart-oil-heater-control-system-inputs";
|
static const char *TAG = "smart-oil-heater-control-system-inputs";
|
||||||
@ -157,6 +158,8 @@ void taskInput(void *pvParameters)
|
|||||||
ESP_LOGW(TAG, "More 1-Wire devices found than expected!");
|
ESP_LOGW(TAG, "More 1-Wire devices found than expected!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (size_t iReadLoop = 0; iReadLoop < ONE_WIRE_LOOPS; iReadLoop++)
|
||||||
|
{
|
||||||
if (ds18x20_measure_and_read_multi(uDS18B20Pin, uOneWireAddresses, sSensorCount, fDS18B20Temps) != ESP_OK)
|
if (ds18x20_measure_and_read_multi(uDS18B20Pin, uOneWireAddresses, sSensorCount, fDS18B20Temps) != ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGE(TAG, "1-Wire devices read error");
|
ESP_LOGE(TAG, "1-Wire devices read error");
|
||||||
@ -194,6 +197,8 @@ void taskInput(void *pvParameters)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xSemaphoreGiveRecursive(xMutexAccessInputs);
|
xSemaphoreGiveRecursive(xMutexAccessInputs);
|
||||||
|
Loading…
Reference in New Issue
Block a user