Store the RXs initrate during connect, not disconnect #3235
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Moves the storage of the RX's Initial Rate (the packet rate it boots starting from) to during the connect process instead of the disconnect process.
It is inconvenient that the RX only stores the packet rate it expects a connection on when it disconnects. For most users, the TX starts on, they plug in an RX and wait for it to connect, fly, then unplug the RX before it ever experiences a disconnect. This does not update the initrate and they have to wait on the next battery to cycle through the rates again to find it. This PR saves the initrate as soon as the first matching SYNC packet comes in, rather than waiting for a disconnect. This is in line with what the user expects to happen, rather than knowing that "ExpressLRS does it weird, you have to turn off the TX now to 'lock' the packet rate"
The downside to doing this is the first time the RX gets a connection, the EEPROM write will cause a hiccup in the connection process and a delay in connecting, which is why it was done on disconnect. This hiccup will only occur when the rate changes:
The first case above can be reduced by leaving the old code in as well as adding the new line, but the hiccup is so short I don't think it justifies the maintenance burden of duplicating the code.
Log
3.5?!
I'd love to get this in 3.x because 3.x is going to probably hang around for a long time despite 4.0 coming soon and it would be nice to have this confusing behavior gone in the final 3.x version.