Handle fails more properly
This commit is contained in:
parent
58abf4ec9b
commit
ce8427b0aa
@ -176,7 +176,7 @@ void app_main(void)
|
|||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
fails += 1;
|
fails += 1;
|
||||||
ESP_LOGE(TAG, "Failed to synchronise device!");
|
ESP_LOGE(TAG, "Failed to synchronise device! (number=%d)", fails);
|
||||||
|
|
||||||
// Safely turn off all relays after a given number of failures
|
// Safely turn off all relays after a given number of failures
|
||||||
if (fails > 5)
|
if (fails > 5)
|
||||||
@ -197,6 +197,8 @@ void app_main(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fails = 0;
|
||||||
|
|
||||||
// TODO : apply sync
|
// TODO : apply sync
|
||||||
sync_response_print(res);
|
sync_response_print(res);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user