Skip to content

Commit

Permalink
remove CONFIG_FILE from platformio.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
rennancockles committed Nov 6, 2024
1 parent 285571e commit 5732e71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ build_flags =
-DEEPROMSIZE=128
-DLH=8
-DLW=6
-DCONFIG_FILE='"/bruce.conf"'
-w
-Wl,--print-memory-usage
-Wl,--gc-sections
Expand Down Expand Up @@ -1261,7 +1260,7 @@ build_flags =
; SERIAL (GPS) dedicated pins
-DSERIAL_TX=1
-DSERIAL_RX=3

;Battery ADC read pin
;-DBAT_PIN=10

Expand Down
4 changes: 2 additions & 2 deletions src/core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class BruceConfig {
String pwd;
};

const char *filepath = "/bruce.conf";

// Theme colors in RGB565 format
uint16_t priColor = 0xA80F;
uint16_t secColor = 0x880F;
Expand Down Expand Up @@ -115,8 +117,6 @@ class BruceConfig {
void setDevMode(int value);
void validateDevModeValue();

private:
const char *filepath = "/bruce.conf";
};

#endif
5 changes: 2 additions & 3 deletions src/core/serialcmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,8 @@ bool processSerialCommand(String cmd_str) {

if(cmd_str == "factory_reset") {
// remove config file and recreate
if(SD.exists(CONFIG_FILE)) SD.remove(CONFIG_FILE);
if(LittleFS.exists(CONFIG_FILE)) LittleFS.remove(CONFIG_FILE);
// TODO: need to reset EEPROM too?
if(SD.exists(bruceConfig.filepath)) SD.remove(bruceConfig.filepath);
if(LittleFS.exists(bruceConfig.filepath)) LittleFS.remove(bruceConfig.filepath);
bruceConfig.fromFile(); // recreate config file if it does not exists
return true;
}
Expand Down

0 comments on commit 5732e71

Please sign in to comment.