trunk fmt

This commit is contained in:
Thomas Göttgens 2024-03-08 13:22:06 +01:00
parent a9fc31c026
commit a7c0109349
5 changed files with 34 additions and 32 deletions

View File

@ -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];

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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