mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-05-08 05:56:11 +02:00
Queues are emptied at begining of card thread.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -159,6 +159,15 @@ void card_init_core1() {
|
||||
size_t finished_data_size = 0;
|
||||
|
||||
void card_start(void (*func)(void)) {
|
||||
uint32_t m = 0;
|
||||
while (queue_is_empty(&usb_to_card_q) == false) {
|
||||
if (queue_try_remove(&usb_to_card_q, &m) == false)
|
||||
break;
|
||||
}
|
||||
while (queue_is_empty(&card_to_usb_q) == false) {
|
||||
if (queue_try_remove(&card_to_usb_q, &m) == false)
|
||||
break;
|
||||
}
|
||||
multicore_reset_core1();
|
||||
multicore_launch_core1(func);
|
||||
led_set_blink(BLINK_MOUNTED);
|
||||
|
||||
Reference in New Issue
Block a user