From fa60f15ea7655aa0d0a3706359e89b1ea2107602 Mon Sep 17 00:00:00 2001 From: Thomas Osterried Date: Wed, 19 Jun 2024 22:28:07 +0200 Subject: [PATCH] minor fixes and cleanups - new delay concept for aprsis to rf / kiss to rf / serial tnc to rf -> prevents flooding rf channel - work on code handling variable nextTX (fix cleanup). - Course-change.detection ignored on high speed: During review of my code I saw if nextTX was set to 1 due to course change, it was re-set in the next tests below to sb_min_intervali. if current speed was >= sb_max_speed. - if we TXed in the last round and have in this round detected a course change, we don't TX this round; we now remember that condition for the next rounds until 5-20s time has passed): if (tmp_t_since_last_sb_tx >= (6000000L / lora_speed) && (lastPositionTX + nextTX) < millis()) .. Signed-off-by: Thomas Osterried --- src/TTGO_T-Beam_LoRa_APRS.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 4a13a69..aa36445 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -7389,9 +7389,9 @@ invalid_packet: boolean display_was_updated = false; ulong tmp_t_since_last_sb_tx = millis() - lastPositionTX; - static boolean reason_course_change = 0; // used as hint for sendpacket. static, because - // we may not be sure (if we are not TXing now but in one of the next rounds) - // when looking at nextTX == 0: was the reason a course change + static boolean reason_course_change = false; // used as hint for sendpacket. static, because + // we may not be sure (if we are not TXing now but in one of the next rounds) + // when looking at nextTX == 0: was the reason a course change // Send position, if not requested to do not ;) But enter this part if user likes our LA/LON/SPD/CRS to be displayed on his screen ('!gps_allow_sleep_while_kiss' caused 'gps_state false') if (!gps_state && (!dont_send_own_position_packets || !(lora_tx_enabled || aprsis_enabled))) @@ -7507,7 +7507,7 @@ invalid_packet: writedisplaytext(" ((TX))","",OledLine2,OledLine3,OledLine4,OledLine5); } sendpacket(SP_POS_GPS | (reason_course_change ? SP_ENFORCE_COURSE : 0 )); - reason_course_change = 0; + reason_course_change = false; // for fixed beacon (if we loose gps fix, we'll send our last position in fix_beacon_interval) // We just transmitted. We transmitted due to turn (nextTX == 1)? Also Don't TX again in next round, sendpacket() adjustet nextTX } else {