@@ -87,6 +87,7 @@ typedef struct {
87
87
} key_storage_array_t ;
88
88
89
89
typedef struct {
90
+ uint8_t settings_set ; /**< Settings set, do not use defaults */
90
91
uint8_t storages_empty ; /**< Number of empty i.e. to be allocated storages */
91
92
uint16_t storage_default_size ; /**< Default size for storages */
92
93
uint16_t replace_index ; /**< Index to replace when storages are full */
@@ -138,6 +139,7 @@ int8_t ws_pae_key_storage_memory_set(uint8_t key_storages_number, const uint16_t
138
139
139
140
int8_t ws_pae_key_storage_settings_set (uint8_t alloc_max_number , uint16_t alloc_size , uint16_t storing_interval )
140
141
{
142
+ key_storage_params .settings_set = true;
141
143
key_storage_params .storages_empty = alloc_max_number ;
142
144
key_storage_params .storage_default_size = alloc_size ;
143
145
key_storage_params .store_timer = storing_interval ;
@@ -148,12 +150,14 @@ int8_t ws_pae_key_storage_settings_set(uint8_t alloc_max_number, uint16_t alloc_
148
150
149
151
void ws_pae_key_storage_init (void )
150
152
{
151
- key_storage_params .storages_empty = DEFAULT_NUMBER_OF_STORAGES ;
152
- key_storage_params .storage_default_size = STORAGE_ARRAY_HEADER_LEN + (sizeof (sec_prot_keys_storage_t ) * DEFAULT_NUMBER_OF_ENTRIES_IN_ONE_STORAGE );
153
+ if (!key_storage_params .settings_set ) {
154
+ key_storage_params .storages_empty = DEFAULT_NUMBER_OF_STORAGES ;
155
+ key_storage_params .storage_default_size = STORAGE_ARRAY_HEADER_LEN + (sizeof (sec_prot_keys_storage_t ) * DEFAULT_NUMBER_OF_ENTRIES_IN_ONE_STORAGE );
156
+ key_storage_params .store_timer = DEFAULT_STORING_INTERVAL ;
157
+ key_storage_params .store_timer_timeout = DEFAULT_STORING_INTERVAL ;
158
+ }
153
159
key_storage_params .replace_index = 0 ;
154
160
key_storage_params .store_bitfield = 0 ,
155
- key_storage_params .store_timer_timeout = DEFAULT_STORING_INTERVAL ;
156
- key_storage_params .store_timer = DEFAULT_STORING_INTERVAL ;
157
161
key_storage_params .restart_cnt = 0 ;
158
162
}
159
163
0 commit comments