mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
* RP2040 build fixes
* new prefs file now "/prefs.json"
This commit is contained in:
@@ -65,7 +65,7 @@ private:
|
|||||||
};
|
};
|
||||||
RadioPrefs radio;
|
RadioPrefs radio;
|
||||||
|
|
||||||
class GPSPrefs : public ConfigSerializer { // COPIED from CommionCLI (for now)
|
class GPSPrefs : public ConfigSerializer { // COPIED from CommonCLI (for now)
|
||||||
NodePrefs* _parent;
|
NodePrefs* _parent;
|
||||||
protected:
|
protected:
|
||||||
void structure() override {
|
void structure() override {
|
||||||
@@ -78,7 +78,7 @@ private:
|
|||||||
};
|
};
|
||||||
GPSPrefs gps;
|
GPSPrefs gps;
|
||||||
|
|
||||||
class RepeatPrefs : public ConfigSerializer { // COPIED from CommionCLI (for now)
|
class RepeatPrefs : public ConfigSerializer { // COPIED from CommonCLI (for now)
|
||||||
public:
|
public:
|
||||||
uint8_t disable_fwd = 1;
|
uint8_t disable_fwd = 1;
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
+1
-1
@@ -100,7 +100,7 @@ lib_deps =
|
|||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
upload_protocol = picotool
|
upload_protocol = picotool
|
||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#4e22a0d ; framework-arduinopico @ 1.50600.0+sha.6a1d13e9
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git ; framework-arduinopico @ 1.50600.0+sha.6a1d13e9
|
||||||
build_flags = ${arduino_base.build_flags}
|
build_flags = ${arduino_base.build_flags}
|
||||||
-D RP2040_PLATFORM
|
-D RP2040_PLATFORM
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,12 @@ static bool isValidName(const char *n) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CommonCLI::loadPrefs(FILESYSTEM* fs) {
|
void CommonCLI::loadPrefs(FILESYSTEM* fs) {
|
||||||
if (fs->exists("/ser_prefs")) {
|
if (fs->exists("/prefs.json")) {
|
||||||
File file = fs->open("/ser_prefs");
|
#if defined(RP2040_PLATFORM)
|
||||||
|
File file = fs->open("/prefs.json", "r");
|
||||||
|
#else
|
||||||
|
File file = fs->open("/prefs.json");
|
||||||
|
#endif
|
||||||
if (file) {
|
if (file) {
|
||||||
_prefs->loadSerial(file); // new Serial prefs
|
_prefs->loadSerial(file); // new Serial prefs
|
||||||
file.close();
|
file.close();
|
||||||
@@ -137,12 +141,12 @@ void CommonCLI::loadPrefsInt(FILESYSTEM* fs, const char* filename) { // Legacy
|
|||||||
|
|
||||||
bool CommonCLI::savePrefs(FILESYSTEM* fs) {
|
bool CommonCLI::savePrefs(FILESYSTEM* fs) {
|
||||||
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
||||||
fs->remove("/ser_prefs");
|
fs->remove("/prefs.json");
|
||||||
File file = fs->open("/ser_prefs", FILE_O_WRITE);
|
File file = fs->open("/prefs.json", FILE_O_WRITE);
|
||||||
#elif defined(RP2040_PLATFORM)
|
#elif defined(RP2040_PLATFORM)
|
||||||
File file = fs->open("/ser_prefs", "w");
|
File file = fs->open("/prefs.json", "w");
|
||||||
#else
|
#else
|
||||||
File file = fs->open("/ser_prefs", "w", true);
|
File file = fs->open("/prefs.json", "w", true);
|
||||||
#endif
|
#endif
|
||||||
if (file) {
|
if (file) {
|
||||||
bool success = _prefs->saveSerial(file);
|
bool success = _prefs->saveSerial(file);
|
||||||
|
|||||||
Reference in New Issue
Block a user