fix: set the radio up for a new config before anything transmits on it

setConfig() swapped the config in and released the radio lock, and apply()
only ran later from save(), so the radio task could send queued jobs with
the new TX pin and settings on a CC1101 that wasn't set up for them.
setConfig() now swaps, saves and applies under one lock and save() goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-12 18:33:59 +02:00
parent 0ba5260d1d
commit c4472ba8e8
4 changed files with 9 additions and 11 deletions

View file

@ -482,8 +482,8 @@ class Transceiver {
bool printBuffer = false;
//bool toJSON(JsonObject& obj);
bool fromJSON(JsonObject& obj);
// Swaps in, saves and applies the config.
void setConfig(const transceiver_config_t &cfg);
bool save();
bool begin();
void loop();
bool end();