mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-09-07 10:53:17 +02:00
Enable modules to persist data (#26201)
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user