tasks are run again when they fail

This commit is contained in:
sessionm21 2020-05-16 07:19:31 +01:00
parent abae29c78b
commit 869b2cab3c

View File

@ -266,6 +266,7 @@ void do_send(osjob_t* j){
send_lora(); send_lora();
} }
#define TIMEOUT TX_INTERVAL * 2 * 1000UL
void on_wait_lora() { void on_wait_lora() {
if(millis()- since > TX_INTERVAL*1000UL || done_sending) { if(millis()- since > TX_INTERVAL*1000UL || done_sending) {
Serial.println(" -Lora Done Sending"); Serial.println(" -Lora Done Sending");
@ -273,6 +274,9 @@ void on_wait_lora() {
state = START_GPS; state = START_GPS;
} }
if(millis()- since > TIMEOUT) {
os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);
}
} }
#define LOOP_LATENCY_MS 200L #define LOOP_LATENCY_MS 200L