Merge pull request #1496 from benner/fix/NodeDB_without_FSCom

Compile when FSCom is not defined (NodeDB.cpp)
This commit is contained in:
Thomas Göttgens 2022-06-07 22:22:20 +02:00 committed by GitHub
commit beb8bc9e72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -308,12 +308,12 @@ static const char *channelfile = "/prefs/channels.proto";
/** Load a protobuf from a file, return true for success */
bool loadProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields, void *dest_struct)
{
bool okay = false;
#ifdef FSCom
// static DeviceState scratch; We no longer read into a tempbuf because this structure is 15KB of valuable RAM
auto f = FSCom.open(filename);
bool okay = false;
if (f) {
DEBUG_MSG("Loading %s\n", filename);
pb_istream_t stream = {&readcb, &f, protoSize};
@ -367,12 +367,12 @@ void NodeDB::loadFromDisk()
/** Save a protobuf from a file, return true for success */
bool saveProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields, const void *dest_struct)
{
bool okay = false;
#ifdef FSCom
// static DeviceState scratch; We no longer read into a tempbuf because this structure is 15KB of valuable RAM
String filenameTmp = filename;
filenameTmp += ".tmp";
auto f = FSCom.open(filenameTmp.c_str(), FILE_O_WRITE);
bool okay = false;
if (f) {
DEBUG_MSG("Saving %s\n", filename);
pb_ostream_t stream = {&writecb, &f, protoSize};