35
35
#endif
36
36
37
37
// Delay before Key/Value is actually saved in NVM
38
- #define SILABS_KVS_SAVE_DELAY_SECONDS 5
38
+ #ifndef SL_KVS_SAVE_DELAY_SECONDS
39
+ #define SL_KVS_SAVE_DELAY_SECONDS 2
40
+ #endif
39
41
40
- static_assert ((KVS_MAX_ENTRIES <= 255 ), "Implementation supports up to 255 Kvs entries");
42
+ static_assert ((KVS_MAX_ENTRIES <= 511 ), "Implementation supports up to 511 Kvs entries");
41
43
static_assert ((KVS_MAX_ENTRIES >= 30 ), "Mininimal Kvs entries requirement is not met");
42
44
43
45
namespace chip {
@@ -89,7 +91,8 @@ class SilabsConfig
89
91
// Persistent counter values set at runtime. Retained during factory reset.
90
92
static constexpr uint8_t kMatterCounter_KeyBase = 0x74 ;
91
93
// Persistent config values set at runtime. Cleared during factory reset.
92
- static constexpr uint8_t kMatterKvs_KeyBase = 0x75 ;
94
+ static constexpr uint8_t kMatterKvs_KeyBase = 0x75 ;
95
+ static constexpr uint8_t kMatterKvs_ExtendedRange = 0x76 ;
93
96
94
97
// Key definitions for well-known configuration values.
95
98
// Factory config keys
@@ -167,7 +170,8 @@ class SilabsConfig
167
170
// Matter KVS storage Keys
168
171
static constexpr Key kConfigKey_KvsStringKeyMap = SilabsConfigKey(kMatterKvs_KeyBase , 0x00 );
169
172
static constexpr Key kConfigKey_KvsFirstKeySlot = SilabsConfigKey(kMatterKvs_KeyBase , 0x01 );
170
- static constexpr Key kConfigKey_KvsLastKeySlot = SilabsConfigKey(kMatterKvs_KeyBase , KVS_MAX_ENTRIES);
173
+ static constexpr Key kConfigKey_KvsLastKeySlot =
174
+ SilabsConfigKey (kMatterKvs_KeyBase + (KVS_MAX_ENTRIES >> 8 ), KVS_MAX_ENTRIES & UINT8_MAX);
171
175
172
176
// Set key id limits for each group.
173
177
static constexpr Key kMinConfigKey_MatterFactory = SilabsConfigKey(kMatterFactory_KeyBase , 0x00 );
@@ -180,7 +184,9 @@ class SilabsConfig
180
184
static constexpr Key kMaxConfigKey_MatterCounter = SilabsConfigKey(kMatterCounter_KeyBase , 0x1F );
181
185
182
186
static constexpr Key kMinConfigKey_MatterKvs = kConfigKey_KvsStringKeyMap ;
183
- static constexpr Key kMaxConfigKey_MatterKvs = kConfigKey_KvsLastKeySlot ;
187
+ static constexpr Key kMaxConfigKey_MatterKvs = SilabsConfigKey(kMatterKvs_ExtendedRange , 0xFF );
188
+ static_assert (kConfigKey_KvsLastKeySlot <= kMaxConfigKey_MatterKvs ,
189
+ " Configured KVS_MAX_ENTRIES overflows the reserved KVS Key range" );
184
190
185
191
static CHIP_ERROR Init (void );
186
192
static void DeInit (void );
0 commit comments