Skip to content

Commit 72c33cb

Browse files
authored
Merge pull request #132 from lora-aprs/fix_current_speed_bug
fix division by zero (current speed)
2 parents cdee7e7 + 04287e4 commit 72c33cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/LoRa_APRS_Tracker.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ void loop() {
367367
would lead to decrease of beacon rate in between 5 to 20 km/h. what
368368
is even below the slow speed rate.
369369
*/
370+
if (curr_speed == 0) {
371+
curr_speed = 1;
372+
}
370373
txInterval = min(BeaconMan.getCurrentBeaconConfig()->smart_beacon.slow_rate,
371374
BeaconMan.getCurrentBeaconConfig()->smart_beacon.fast_speed * BeaconMan.getCurrentBeaconConfig()->smart_beacon.fast_rate / curr_speed) *
372375
1000;

0 commit comments

Comments
 (0)