diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 0f32ac3..6286ef4 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -113,10 +113,7 @@ void loop() { if (!send_update) { GPS_Utils::calculateHeadingDelta(currentSpeed); } - if (!send_update && lastTx >= Config.standingUpdateTime*60*1000) { - send_update = true; - sendStandingUpdate = true; - } + STATION_Utils::checkStandingUpdateTime(); } STATION_Utils::checkSmartBeaconState(); diff --git a/src/station_utils.cpp b/src/station_utils.cpp index dc186ed..e601158 100644 --- a/src/station_utils.cpp +++ b/src/station_utils.cpp @@ -16,8 +16,12 @@ extern String fourthNearTracker; extern uint32_t lastDeleteListenedTracker; extern uint32_t lastTxTime; + extern bool send_update; +extern bool sendStandingUpdate; + extern uint32_t txInterval; +extern uint32_t lastTx; namespace STATION_Utils { @@ -341,6 +345,13 @@ void checkSmartBeaconInterval(int speed) { } } +void checkStandingUpdateTime() { + if (!send_update && lastTx >= Config.standingUpdateTime*60*1000) { + send_update = true; + sendStandingUpdate = true; + } +} + void checkSmartBeaconState() { if (!currentBeacon->smartBeaconState) { uint32_t lastTxSmartBeacon = millis() - lastTxTime; diff --git a/src/station_utils.h b/src/station_utils.h index 20ebb07..6ebaa29 100644 --- a/src/station_utils.h +++ b/src/station_utils.h @@ -14,6 +14,7 @@ void deleteListenedTrackersbyTime(); void checkListenedTrackersByTimeAndDelete(); void orderListenedTrackersByDistance(String callsign, float distance, float course); void checkSmartBeaconInterval(int speed); +void checkStandingUpdateTime(); void checkSmartBeaconState(); }