mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Added Pi PIcoW support in the following modes:
- Companion Radio over USB Serial - Repeater - Room Server - Terminal Chat
This commit is contained in:
parent
a5f210779f
commit
99246e6b6f
13 changed files with 442 additions and 2 deletions
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#if defined(NRF52_PLATFORM)
|
||||
#include <InternalFileSystem.h>
|
||||
#elif defined(RP2040_PLATFORM)
|
||||
#include <LittleFS.h>
|
||||
#elif defined(ESP32)
|
||||
#include <SPIFFS.h>
|
||||
#endif
|
||||
|
|
@ -88,7 +90,11 @@ class MyMesh : public BaseChatMesh, ContactVisitor {
|
|||
|
||||
void loadContacts() {
|
||||
if (_fs->exists("/contacts")) {
|
||||
#if defined(RP2040_PLATFORM)
|
||||
File file = _fs->open("/contacts", "r");
|
||||
#else
|
||||
File file = _fs->open("/contacts");
|
||||
#endif
|
||||
if (file) {
|
||||
bool full = false;
|
||||
while (!full) {
|
||||
|
|
@ -123,6 +129,8 @@ class MyMesh : public BaseChatMesh, ContactVisitor {
|
|||
#if defined(NRF52_PLATFORM)
|
||||
File file = _fs->open("/contacts", FILE_O_WRITE);
|
||||
if (file) { file.seek(0); file.truncate(); }
|
||||
#elif defined(RP2040_PLATFORM)
|
||||
File file = _fs->open("/contacts", "w+");
|
||||
#else
|
||||
File file = _fs->open("/contacts", "w", true);
|
||||
#endif
|
||||
|
|
@ -309,7 +317,11 @@ public:
|
|||
|
||||
// load persisted prefs
|
||||
if (_fs->exists("/node_prefs")) {
|
||||
#if defined(RP2040_PLATFORM)
|
||||
File file = _fs->open("/node_prefs", "r");
|
||||
#else
|
||||
File file = _fs->open("/node_prefs");
|
||||
#endif
|
||||
if (file) {
|
||||
file.read((uint8_t *) &_prefs, sizeof(_prefs));
|
||||
file.close();
|
||||
|
|
@ -324,6 +336,8 @@ public:
|
|||
#if defined(NRF52_PLATFORM)
|
||||
File file = _fs->open("/node_prefs", FILE_O_WRITE);
|
||||
if (file) { file.seek(0); file.truncate(); }
|
||||
#elif defined(RP2040_PLATFORM)
|
||||
File file = _fs->open("/node_prefs", "w+");
|
||||
#else
|
||||
File file = _fs->open("/node_prefs", "w", true);
|
||||
#endif
|
||||
|
|
@ -545,6 +559,9 @@ void setup() {
|
|||
#if defined(NRF52_PLATFORM)
|
||||
InternalFS.begin();
|
||||
the_mesh.begin(InternalFS);
|
||||
#elif defined(RP2040_PLATFORM)
|
||||
LittleFS.begin();
|
||||
the_mesh.begin(LittleFS);
|
||||
#elif defined(ESP32)
|
||||
SPIFFS.begin(true);
|
||||
the_mesh.begin(SPIFFS);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue