diff --git a/collar.cpp b/collar.cpp index 94674f1..dc137de 100644 --- a/collar.cpp +++ b/collar.cpp @@ -55,6 +55,7 @@ void os_getDevKey (u1_t* buf) { } // Data Packet to Send to TTN static osjob_t sendjob; +static osjob_t gpsjob; // Schedule TX every this many seconds (might become longer due to duty // cycle limitations). @@ -230,7 +231,7 @@ void do_gps(osjob_t* j){ if(!is_sending && gps.location.isValid()) { do_send(&sendjob); } - os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(GPS_INTERVAL), do_gps); + os_setTimedCallback(&gpsjob, os_getTime()+sec2osticks(GPS_INTERVAL), do_gps); } void setup() { @@ -267,7 +268,7 @@ void setup() { // Set data rate and transmit power for uplink LMIC_setDrTxpow(DR_SF7,14); - os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(GPS_INTERVAL), do_gps); + os_setTimedCallback(&gpsjob, os_getTime()+sec2osticks(GPS_INTERVAL), do_gps); } void loop() {