Skip to content

Commit

Permalink
Reset config retains the domain
Browse files Browse the repository at this point in the history
  • Loading branch information
CapnBry committed Jan 25, 2024
1 parent 6431f1f commit fbfd839
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/OPTIONS/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ static void options_LoadFromFlashOrFile(EspFlashStream &strmFlash)
void options_SetTrueDefaults()
{
DynamicJsonDocument doc(128);
// The Regulatory Domain is retained, as there is no sensible default
doc["domain"] = firmwareOptions.domain;
doc["flash-discriminator"] = flash_discriminator;

File options = SPIFFS.open("/options.json", "w");
Expand Down
1 change: 1 addition & 0 deletions src/src/rx_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,7 @@ void resetConfigAndReboot()
yield();
// Remove options.json and hardware.json
SPIFFS.format();
yield();
SPIFFS.begin();
options_SetTrueDefaults();

Expand Down

0 comments on commit fbfd839

Please sign in to comment.