mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-18 16:52:27 +00:00
clean up filesystem goo, add spiffs to install scripts, fix #496
@mc-hamster seems to work pretty good for me, so I'll send a PR to you for the dev-http branch. I'll push out an android alpha build later today (once the build is complete). Once this new device load is out in the field _future_ device builds will support updating spiffs from android. (i.e. device loads older than 1.1.9 must be updated to 1.1.9 or later before spiffs support is implemented on the device side - so some users might need to update twice before the new spiffs contents will appear on their device)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "error.h"
|
||||
#include "mesh-pb-constants.h"
|
||||
#include "meshwifi/meshwifi.h"
|
||||
#include "FSCommon.h"
|
||||
#include <pb_decode.h>
|
||||
#include <pb_encode.h>
|
||||
|
||||
@@ -35,27 +36,7 @@ DeviceState versions used to be defined in the .proto file but really only this
|
||||
#define DEVICESTATE_CUR_VER 11
|
||||
#define DEVICESTATE_MIN_VER DEVICESTATE_CUR_VER
|
||||
|
||||
#ifdef PORTDUINO
|
||||
// Portduino version
|
||||
#include "PortduinoFS.h"
|
||||
#define FS PortduinoFS
|
||||
#define FSBegin() true
|
||||
#define FILE_O_WRITE "w"
|
||||
#define FILE_O_READ "r"
|
||||
#elif !defined(NO_ESP32)
|
||||
// ESP32 version
|
||||
#include "SPIFFS.h"
|
||||
#define FS SPIFFS
|
||||
#define FSBegin() FS.begin(true)
|
||||
#define FILE_O_WRITE "w"
|
||||
#define FILE_O_READ "r"
|
||||
#else
|
||||
// NRF52 version
|
||||
#include "InternalFileSystem.h"
|
||||
#define FS InternalFS
|
||||
#define FSBegin() FS.begin()
|
||||
using namespace Adafruit_LittleFS_Namespace;
|
||||
#endif
|
||||
|
||||
|
||||
// FIXME - move this somewhere else
|
||||
extern void getMacAddr(uint8_t *dmac);
|
||||
@@ -210,12 +191,6 @@ void NodeDB::init()
|
||||
{
|
||||
installDefaultDeviceState();
|
||||
|
||||
if (!FSBegin()) // FIXME - do this in main?
|
||||
{
|
||||
DEBUG_MSG("ERROR filesystem mount Failed\n");
|
||||
assert(0); // FIXME - report failure to phone
|
||||
}
|
||||
|
||||
// saveToDisk();
|
||||
loadFromDisk();
|
||||
// saveToDisk();
|
||||
|
||||
Reference in New Issue
Block a user