From 012cd0b5244071b08f737ddfc5e148dbdb1329ec Mon Sep 17 00:00:00 2001 From: Max-Plastix Date: Sun, 5 Dec 2021 18:37:46 -0800 Subject: [PATCH] Avoid sending packets while Tx is busy --- main/configuration.h | 2 +- main/main.ino | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/main/configuration.h b/main/configuration.h index 051d1bc..4ad73ce 100644 --- a/main/configuration.h +++ b/main/configuration.h @@ -33,7 +33,7 @@ void ttn_register(void (*callback)(uint8_t message)); // ----------------------------------------------------------------------------- #define APP_NAME "Helium TTGO" -#define APP_VERSION "1.31 MaxP" +#define APP_VERSION "1.32 MaxP" // ----------------------------------------------------------------------------- // Configuration diff --git a/main/main.ino b/main/main.ino index 429172c..8f33d0a 100644 --- a/main/main.ino +++ b/main/main.ino @@ -145,7 +145,7 @@ bool trySend() send_now = false; } - if (send_now) + if (send_now && LMIC_queryTxReady()) { //snprintf(buffer, sizeof(buffer), "Moved %4.1fm\n", dist_moved); // The first distance is crazy.. don't put it on screen. @@ -169,9 +169,7 @@ bool trySend() last_send_lat = gps_latitude(); last_send_lon = gps_longitude(); return true; - } - else - { + } else { // snprintf(buffer, sizeof(buffer), "Still: %4.1fm\n", dist_moved); // screen_print(buffer); return false;