Enable modules to persist data (#26201)

This commit is contained in:
Joel Challis
2026-06-18 18:43:32 +01:00
committed by GitHub
parent 721affff7b
commit 8522bb342d
11 changed files with 304 additions and 32 deletions
+8
View File
@@ -39,6 +39,10 @@
# include "connection.h"
#endif // CONNECTION_ENABLE
#ifdef COMMUNITY_MODULES_ENABLE
# include "community_modules.h"
#endif
#ifdef VIA_ENABLE
bool via_eeprom_is_valid(void);
void via_eeprom_set_valid(bool valid);
@@ -148,6 +152,10 @@ void eeconfig_init_quantum(void) {
eeconfig_init_user_datablock();
#endif // (EECONFIG_USER_DATA_SIZE) > 0
#ifdef COMMUNITY_MODULES_ENABLE
eeconfig_init_modules_datablock();
#endif // COMMUNITY_MODULES_ENABLE
#if defined(VIA_ENABLE)
// Invalidate VIA eeprom config, and then reset.
// Just in case if power is lost mid init, this makes sure that it gets
@@ -56,8 +56,14 @@ typedef struct PACKED {
#define EECONFIG_KB_DATABLOCK ((uint8_t *)(EECONFIG_BASE_SIZE))
#define EECONFIG_USER_DATABLOCK ((uint8_t *)((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE)))
#define EECONFIG_MODULES_DATABLOCK ((uint8_t *)((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE) + (EECONFIG_USER_DATA_SIZE)))
// Actual value is injected via the generated community_post_config.h
#ifndef EECONFIG_MODULE_DATA_SIZE
# define EECONFIG_MODULE_DATA_SIZE 0
#endif
// Size of EEPROM being used, other code can refer to this for available EEPROM
#define EECONFIG_SIZE ((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE) + (EECONFIG_USER_DATA_SIZE))
#define EECONFIG_SIZE ((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE) + (EECONFIG_USER_DATA_SIZE) + (EECONFIG_MODULE_DATA_SIZE))
STATIC_ASSERT((intptr_t)EECONFIG_HANDEDNESS == 14, "EEPROM handedness offset is incorrect");