diff --git a/collar.cpp b/collar.cpp index 25634ef..f4ee3ab 100644 --- a/collar.cpp +++ b/collar.cpp @@ -174,7 +174,6 @@ uint8_t buffer[] = { void do_send(osjob_t* j){ // Check if there is not a current TX/RX job running - is_sending = 1; if (LMIC.opmode & OP_TXRXPEND) { Serial.println(F("OP_TXRXPEND, not sending")); } else { @@ -199,6 +198,7 @@ void do_gps(osjob_t* j){ gps.encode(softserial_read()); } if(!is_sending && gps.location.isValid()) { + is_sending = 1; do_send(&sendjob); } os_setTimedCallback(&gpsjob, os_getTime()+sec2osticks(GPS_INTERVAL), do_gps);