mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +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++){
|
for (i=0;i<NVM_NUM_LINK_KEYS;i++){
|
||||||
link_key_read(i, &item);
|
link_key_read(i, &item);
|
||||||
if (item.magic != LINK_KEY_MAGIC) return i;
|
if (item.magic != LINK_KEY_MAGIC) return i;
|
||||||
if ((lowest_index != -1) && (item.seq_nr < seq_nr)) continue;
|
if ((lowest_index < 0) || (item.seq_nr < seq_nr)){
|
||||||
lowest_index = i;
|
lowest_index = i;
|
||||||
seq_nr= item.seq_nr;
|
seq_nr= item.seq_nr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return lowest_index;
|
return lowest_index;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user