From 869b2cab3cab1daaeabff2e16c9fd7125599a95c Mon Sep 17 00:00:00 2001 From: sessionm21 Date: Sat, 16 May 2020 07:19:31 +0100 Subject: [PATCH] tasks are run again when they fail --- collar.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/collar.cpp b/collar.cpp index 8b18b54..4c52db2 100644 --- a/collar.cpp +++ b/collar.cpp @@ -266,6 +266,7 @@ void do_send(osjob_t* j){ send_lora(); } +#define TIMEOUT TX_INTERVAL * 2 * 1000UL void on_wait_lora() { if(millis()- since > TX_INTERVAL*1000UL || done_sending) { Serial.println(" -Lora Done Sending"); @@ -273,6 +274,9 @@ void on_wait_lora() { state = START_GPS; } + if(millis()- since > TIMEOUT) { + os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send); + } } #define LOOP_LATENCY_MS 200L