rp2/mphalport: Add a timeout to mp_hal_stdout_tx_strn().

If USB CDC is connected and the board sends data, but the host does not
receive the data, the device locks up.  This is fixed in this commit by
having a timeout of 500ms, after which time the transmission is skipped.

Fixes issue #9634.
This commit is contained in:
robert-hh
2022-10-16 12:06:58 +02:00
committed by Damien George
parent d0687e90ab
commit 8447fef9f9
2 changed files with 7 additions and 1 deletions

View File

@@ -33,6 +33,7 @@
#include "RP2040.h" // cmsis, for __WFI
#define SYSTICK_MAX (0xffffff)
#define MICROPY_HW_USB_CDC_TX_TIMEOUT (500)
extern int mp_interrupt_char;
extern ringbuf_t stdin_ringbuf;