From ff4d343d8cd430746a584c22e98743e767b8c8fc Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 18 Sep 2021 17:22:22 -0500 Subject: [PATCH] Fix bug in telemetry timing. --- src/TTGO_T-Beam_LoRa_APRS.ino | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 787984e..8ac1bfc 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -103,8 +103,6 @@ boolean key_up = true; boolean t_lock = false; boolean fixed_beacon_enabled = false; boolean show_cmt = true; -// Telemetry interval, seconds -int tel_interval; // Telemetry sequence, current value int tel_sequence; @@ -122,6 +120,12 @@ int tel_sequence; boolean enable_tel = true; #else boolean enable_tel = false; +#endif + // Telemetry interval, seconds +#ifdef TNC_SELF_TELEMETRY_INTERVAL + int tel_interval = TNC_SELF_TELEMETRY_INTERVAL; +#else + int tel_interval = 3600; #endif #ifdef TNC_SELF_TELEMETRY_MIC int tel_mic = 1; // telemetry as "T#MIC" @@ -557,7 +561,11 @@ String prepareCallsign(const String& callsign){ #endif // Update the telemetry sequence number - tel_sequence = tel_sequence + 1; + if(tel_sequence >= 999){ + tel_sequence = 0; + }else{ + tel_sequence = tel_sequence + 1; + } preferences.putUInt(PREF_TNC_SELF_TELEMETRY_SEQ, tel_sequence); }