From c646a594ce595c953443d52999dbbb6609682383 Mon Sep 17 00:00:00 2001 From: bkleiner Date: Sun, 5 Nov 2023 03:20:58 +0100 Subject: [PATCH] elrs: delay mode switch after flash save --- src/rx/express_lrs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rx/express_lrs.c b/src/rx/express_lrs.c index 1ee99932c..67410116a 100644 --- a/src/rx/express_lrs.c +++ b/src/rx/express_lrs.c @@ -125,6 +125,8 @@ static uint8_t msp_origin = 0; static bool msp_new_data = false; static bool msp_is_error = false; +static bool has_run_once = false; + static uint32_t elrs_get_uid_mac_seed() { return ((uint32_t)UID[2] << 24) + ((uint32_t)UID[3] << 16) + ((uint32_t)UID[4] << 8) + (UID[5] ^ ELRS_OTA_VERSION_ID); @@ -809,7 +811,7 @@ bool rx_expresslrs_check() { // it is possible we caught a packet during boot, but it will be stale by now // read the irq state above, but ignore it during the first run of this function - static bool has_run_once = false; + // same applies for after flash safe, anything caugth will be stale if (!has_run_once) { // delay mode cycle a bit last_rf_mode_cycle_millis = time_millis(); @@ -883,6 +885,7 @@ void rx_expresslrs_stop() { return; } elrs_connection_lost(time_millis()); + has_run_once = false; } #endif \ No newline at end of file