Skip to content

Commit

Permalink
elrs: delay mode switch after flash save
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Nov 5, 2023
1 parent d25d35c commit c646a59
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rx/express_lrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -883,6 +885,7 @@ void rx_expresslrs_stop() {
return;
}
elrs_connection_lost(time_millis());
has_run_once = false;
}

#endif

0 comments on commit c646a59

Please sign in to comment.