Skip to content

Commit

Permalink
a macro for the settings file path
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Oct 5, 2023
1 parent 04a8b61 commit a0b002f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions software/firmware/source/SoftRF/SoftRF.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#define LED_EXPIRATION_TIME 5 /* seconds */
#define EXPORT_EXPIRATION_TIME 5 /* seconds */

#define SETTINGS_JSON_PATH "/settings.json"

/*
* If you need for SoftRF to operate in wireless
* client mode - specify your local AP's SSID/PSK:
Expand Down
2 changes: 1 addition & 1 deletion software/firmware/source/SoftRF/src/platform/ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2509,7 +2509,7 @@ static void ESP32_EEPROM_extension(int cmd)
if (cmd == EEPROM_EXT_LOAD) {
#if defined(CONFIG_IDF_TARGET_ESP32S3)
if ( ESP32_has_spiflash && FATFS_is_mounted ) {
File32 file = fatfs.open("/settings.json", FILE_READ);
File32 file = fatfs.open(SETTINGS_JSON_PATH, FILE_READ);

if (file) {
// StaticJsonBuffer<ESP32_JSON_BUFFER_SIZE> ESP32_jsonBuffer;
Expand Down
2 changes: 1 addition & 1 deletion software/firmware/source/SoftRF/src/platform/RP2040.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ static void RP2040_EEPROM_extension(int cmd)
if (cmd == EEPROM_EXT_LOAD) {

if ( RP2040_has_spiflash && FATFS_is_mounted ) {
File32 file = fatfs.open("/settings.json", FILE_READ);
File32 file = fatfs.open(SETTINGS_JSON_PATH, FILE_READ);

if (file) {
// StaticJsonBuffer<RP2040_JSON_BUFFER_SIZE> RP2040_jsonBuffer;
Expand Down
2 changes: 1 addition & 1 deletion software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ static void nRF52_EEPROM_extension(int cmd)
}

if ( nRF52_has_spiflash && FATFS_is_mounted ) {
File32 file = fatfs.open("/settings.json", FILE_READ);
File32 file = fatfs.open(SETTINGS_JSON_PATH, FILE_READ);

if (file) {
// StaticJsonBuffer<NRF52_JSON_BUFFER_SIZE> nRF52_jsonBuffer;
Expand Down

0 comments on commit a0b002f

Please sign in to comment.