Skip to content

Commit 9f44896

Browse files
committed
Resume the BT Connection from the original list if connection was not successfully established during resume so GC can free up the area
1 parent b728776 commit 9f44896

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

esp32/mods/modbt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,10 @@ void bt_resume(bool reconnect)
428428
// As modbt_connect appends the new connection to the original list, it needs to be removed because it is not needed
429429
mp_obj_list_remove((void *)&MP_STATE_PORT(btc_conn_list), new_connection_obj);
430430
}
431+
else {
432+
// Remove the old connection from the original list because connection could not be established with it
433+
mp_obj_list_remove((void *)&MP_STATE_PORT(btc_conn_list), connection_obj);
434+
}
431435
}
432436

433437
/* See if there was an advertisement active before Sleep */

0 commit comments

Comments
 (0)