temp sync broken

This commit is contained in:
2025-12-30 08:04:26 +01:00
parent 31dda62474
commit 3b2ec32532
27 changed files with 1339 additions and 589 deletions

View File

@@ -6,18 +6,14 @@
#define FLASH_USER_PAGE_ADDR ((const void *)(0x08077F00))
#define AESKeyCount 8
#define ChannelCount 8
#define CONTACT_COUNT 100
typedef struct {
uint32_t magic; // e.g. 0xDEADBEEF
uint8_t privkey[32]; // Ed25519 private
uint8_t pubkey[32]; // Ed25519 public
uint8_t nodeType;
int32_t latitude;
int32_t longitude;
int32_t altitude;
#define VERSION "v0.0.1 - BRN Systems RISC-V"
#define BOARD "WCH CH32V307"
typedef struct LoRaSettings {
int8_t txPowerInDbm;
uint32_t frequencyInHz;
uint8_t spreadingFactor;
@@ -25,11 +21,35 @@ typedef struct {
uint8_t codingRate;
uint16_t preambleLength;
float tcxoVoltage;
} LoRaSettings;
uint8_t aesKeys[AESKeyCount][17];
uint8_t password[16];
extern LoRaSettings currentLoRaSettings;
typedef struct {
uint32_t magic; // e.g. 0xDEADBEEF
uint8_t privkey[32]; // Ed25519 private
uint8_t pubkey[32]; // Ed25519 public
uint8_t nodeType;
char nodeName[32];
int32_t latitude;
int32_t longitude;
int32_t altitude;
LoRaSettings loraSettings;
Channel channels[ChannelCount];
NodeEntry contacts[CONTACT_COUNT];
uint8_t password[16];
uint8_t guestPassword[16];
uint8_t doRepeat;
uint8_t allowReadOnly;
float adcMultiplier;
float airtimeFactor;
uint32_t crc32; // integrity check
} PersistentData_t;
@@ -40,7 +60,20 @@ void loadConfig();
void printNodeDB();
NodeEntry * getNextNode();
NodeEntry *getNextNode();
NodeEntry *getNode (uint8_t hash);
Channel *getChannel (uint8_t hash, uint8_t ignoreCount);
void addChannel (char *name, const uint8_t *key);
NodeEntry *getNodePrefix (const uint8_t *hash);
const char *getStringRole (uint8_t role);
void populateDefaults();
void LoraApply();
NodeEntry * getNode(uint8_t hash);
#endif