Init
This commit is contained in:
22
User/lib/config.h
Normal file
22
User/lib/config.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#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
|
Reference in New Issue
Block a user