22 lines
524 B
C
22 lines
524 B
C
#ifndef CONFIG_HEADER
|
|
#define CONFIG_HEADER
|
|
#include "stdint.h"
|
|
#include "string.h"
|
|
|
|
#define FLASH_USER_PAGE_ADDR ((const void *)(0x08077F00))
|
|
|
|
typedef struct {
|
|
uint32_t magic; // e.g. 0xDEADBEEF
|
|
uint8_t privkey[32]; // Ed25519 private
|
|
uint8_t pubkey[32]; // Ed25519 public
|
|
uint8_t config[128]; // user config
|
|
char nodeName[20];
|
|
uint8_t extra[40];
|
|
uint32_t crc32; // integrity check
|
|
} PersistentData_t;
|
|
|
|
extern PersistentData_t persistent;
|
|
|
|
void saveConfig();
|
|
void loadConfig();
|
|
#endif |