Updated location of eeconfig magic numbers so non-EEPROM nvm drivers can use them too.

This commit is contained in:
Nick Brassel 2024-09-19 00:32:07 +10:00
parent 7847adcdf3
commit 57bcc8cbaf
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View File

@ -6,11 +6,6 @@
#include <stddef.h> // offsetof
#include "eeconfig.h"
#ifndef EECONFIG_MAGIC_NUMBER
# define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEE4 // When changing, decrement this value to avoid future re-init issues
#endif
#define EECONFIG_MAGIC_NUMBER_OFF (uint16_t)0xFFFF
// Dummy struct only used to calculate offsets
typedef struct PACKED {
uint16_t magic;

View File

@ -5,6 +5,11 @@
#include <stdint.h>
#include <stdbool.h>
#ifndef EECONFIG_MAGIC_NUMBER
# define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEE3 // When changing, decrement this value to avoid future re-init issues
#endif
#define EECONFIG_MAGIC_NUMBER_OFF (uint16_t)0xFFFF
void nvm_eeconfig_erase(void);
bool nvm_eeconfig_is_enabled(void);

View File

@ -23,7 +23,7 @@ else
OPT_DEFS += -DNVM_DRIVER_$(NVM_DRIVER_UPPER) -DNVM_DRIVER="$(NVM_DRIVER)"
ifneq ("$(wildcard $(QUANTUM_DIR)/nvm/$(NVM_DRIVER_LOWER))","")
VPATH += $(QUANTUM_DIR)/nvm/$(NVM_DRIVER_LOWER)
COMMON_VPATH += $(QUANTUM_DIR)/nvm/$(NVM_DRIVER_LOWER)
endif
QUANTUM_SRC += nvm_eeconfig.c