correctly run gps job

This commit is contained in:
sessionm21 2020-05-15 13:43:49 +01:00
parent 0adeb9a7b1
commit 2cae488de8

View File

@ -55,6 +55,7 @@ void os_getDevKey (u1_t* buf) { }
// Data Packet to Send to TTN // Data Packet to Send to TTN
static osjob_t sendjob; static osjob_t sendjob;
static osjob_t gpsjob;
// Schedule TX every this many seconds (might become longer due to duty // Schedule TX every this many seconds (might become longer due to duty
// cycle limitations). // cycle limitations).
@ -230,7 +231,7 @@ void do_gps(osjob_t* j){
if(!is_sending && gps.location.isValid()) { if(!is_sending && gps.location.isValid()) {
do_send(&sendjob); 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() { void setup() {
@ -267,7 +268,7 @@ void setup() {
// Set data rate and transmit power for uplink // Set data rate and transmit power for uplink
LMIC_setDrTxpow(DR_SF7,14); 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() { void loop() {