mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-01 00:28:18 +00:00
wiced: fix find oldest link key entry
This commit is contained in:
parent
8cd22e56c3
commit
4a515d8e5d
@ -131,9 +131,10 @@ static int link_key_find_free_entry(void){
|
||||
for (i=0;i<NVM_NUM_LINK_KEYS;i++){
|
||||
link_key_read(i, &item);
|
||||
if (item.magic != LINK_KEY_MAGIC) return i;
|
||||
if ((lowest_index != -1) && (item.seq_nr < seq_nr)) continue;
|
||||
lowest_index = i;
|
||||
seq_nr= item.seq_nr;
|
||||
if ((lowest_index < 0) || (item.seq_nr < seq_nr)){
|
||||
lowest_index = i;
|
||||
seq_nr= item.seq_nr;
|
||||
}
|
||||
}
|
||||
return lowest_index;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user