diff --git a/src/FSCommon.cpp b/src/FSCommon.cpp index 6537529a4..c1b576fee 100644 --- a/src/FSCommon.cpp +++ b/src/FSCommon.cpp @@ -34,30 +34,30 @@ SPIClass SPI1(HSPI); bool copyFile(const char *from, const char *to) { #if defined(ARCH_STM32WL) || defined(ARCH_APOLLO3) - unsigned char cbuffer[2048]; + unsigned char cbuffer[2048]; - // Var to hold the result of actions - OSFS::result r; + // Var to hold the result of actions + OSFS::result r; - r = OSFS::getFile(from, cbuffer); + r = OSFS::getFile(from, cbuffer); + + if (r == notfound) { + LOG_ERROR("Failed to open source file %s\n", from); + return false; + } else if (r == noerr) { + r = OSFS::newFile(to, cbuffer, true); + if (r == noerr) { + return true; + } else { + LOG_ERROR("OSFS Error %d\n", r); + return false; + } - if (r == notfound) { - LOG_ERROR("Failed to open source file %s\n", from); - return false; - } else if (r == noerr) { - r = OSFS::newFile(to, cbuffer, true); - if (r == noerr) { - return true; } else { - LOG_ERROR("OSFS Error %d\n", r); - return false; + LOG_ERROR("OSFS Error %d\n", r); + return false; } - - } else { - LOG_ERROR("OSFS Error %d\n", r); - return false; - } -return true; + return true; #elif defined(FSCom) unsigned char cbuffer[16]; diff --git a/src/FSCommon.h b/src/FSCommon.h index 7fc511937..a99fea131 100644 --- a/src/FSCommon.h +++ b/src/FSCommon.h @@ -33,19 +33,21 @@ const OSFS::result noerr = OSFS::result::NO_ERROR; const OSFS::result notfound = OSFS::result::FILE_NOT_FOUND; // 3) How do I read from the medium? -void OSFS::readNBytes(uint16_t address, unsigned int num, byte* output) { - for (uint16_t i = address; i < address + num; i++) { - *output = EEPROM.read(i); - output++; - } +void OSFS::readNBytes(uint16_t address, unsigned int num, byte *output) +{ + for (uint16_t i = address; i < address + num; i++) { + *output = EEPROM.read(i); + output++; + } } // 4) How to I write to the medium? -void OSFS::writeNBytes(uint16_t address, unsigned int num, const byte* input) { - for (uint16_t i = address; i < address + num; i++) { - EEPROM.update(i, *input); - input++; - } +void OSFS::writeNBytes(uint16_t address, unsigned int num, const byte *input) +{ + for (uint16_t i = address; i < address + num; i++) { + EEPROM.update(i, *input); + input++; + } } #endif diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 87542f65e..0947fab92 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -3,8 +3,8 @@ #include "CryptoEngine.h" #include "MeshRadio.h" #include "NodeDB.h" -#include "gps/RTC.h" #include "configuration.h" +#include "gps/RTC.h" #include "main.h" #include "mesh-pb-constants.h" #include "modules/RoutingModule.h" diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index 80d1442f8..49be64dd0 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -2,12 +2,12 @@ #include "GPS.h" #include "MeshService.h" #include "NodeDB.h" -#include "gps/RTC.h" #include "Router.h" #include "TypeConversions.h" #include "airtime.h" #include "configuration.h" #include "gps/GeoCoord.h" +#include "gps/RTC.h" #include "main.h" #include "meshtastic/atak.pb.h" #include "sleep.h" diff --git a/variants/rak11720/variant.h b/variants/rak11720/variant.h index 82db03f04..30751235e 100644 --- a/variants/rak11720/variant.h +++ b/variants/rak11720/variant.h @@ -176,7 +176,7 @@ static const uint8_t SCK = PIN_SPI_SCK; #define PIN_WIRE_SDA WB_I2C1_SDA #define PIN_WIRE_SCL WB_I2C1_SCL -#define VARIANT_Wire_SDA PIN_WIRE_SDA +#define VARIANT_Wire_SDA PIN_WIRE_SDA #define VARIANT_Wire_SCL PIN_WIRE_SCL #ifdef __cplusplus