8000 Fix serial reset hang under FreeRTOS (#1495) · anrp-tri/arduino-pico@579e366 · GitHub
[go: up one dir, main page]

Skip to content

Commit 579e366

Browse files
Fix serial reset hang under FreeRTOS (earlephilhower#1495)
The serial port reset logic was calling `sleep_ms()` which ended up doing a task switch...while the other core was frozen and everything was supposed to be locked. Use `busy_wait_ms()` which is a tight loop to delay in the reset portion. Fixes earlephilhower#1486
1 parent db4f794 commit 579e366

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/rp2040/SerialUSB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static void CheckSerialReset() {
188188
reset_block(RESETS_RESET_USBCTRL_BITS);
189189
unreset_block(RESETS_RESET_USBCTRL_BITS);
190190
// Delay a bit, so the PC can figure out that we have disconnected.
191-
sleep_ms(3);
191+
busy_wait_ms(3);
192192
reset_usb_boot(0, 0);
193193
while (1); // WDT will fire here
194194
}

0 commit comments

Comments
 (0)
0