micropython/shared/tinyusb
Andrew Leech 8809ae7161 shared/tinyusb: Buffer startup CDC data to send to host on connection.
At startup, buffer initial stdout / MicroyPthon banner so that it can be
sent to the host on initial connection of the USB serial port.  This
buffering also works for when the CDC becomes disconnected and the device
is still printing to stdout, and when CDC is reconnected the most recent
part of stdout (depending on how big the internal USB FIFO is) is flushed
to the host.

This change is most obvious when you've first plugged in a MicroPython
device (or hit reset), when it's a board that uses USB (CDC) serial in the
chip itself for the REPL interface.  This doesn't apply to UART going via a
separate USB-serial chip.

The stm32 port already has this buffering behaviour (it doesn't use
TinyUSB) and this commit extends such behaviour to rp2, mimxrt, samd and
renesas-ra ports, which do use TinyUSB.

Signed-off-by: Andrew Leech <andrew@alelec.net>
2024-06-04 17:49:19 +10:00
..
mp_usbd_cdc.c shared/tinyusb: Buffer startup CDC data to send to host on connection. 2024-06-04 17:49:19 +10:00
mp_usbd_cdc.h shared/tinyusb: Allow ports to use 1200bps-touch without other CDC code. 2024-06-02 23:27:33 +10:00
mp_usbd_descriptor.c extmod/machine_usb_device: Add support for Python USB devices. 2024-03-15 14:22:11 +11:00
mp_usbd_runtime.c shared/tinyusb: Stall the CDC IN endpoint while disconnecting. 2024-05-09 15:22:31 +10:00
mp_usbd.c extmod/machine_usb_device: Add support for Python USB devices. 2024-03-15 14:22:11 +11:00
mp_usbd.h extmod/machine_usb_device: Add support for Python USB devices. 2024-03-15 14:22:11 +11:00
tusb_config.h shared/tinyusb: Buffer startup CDC data to send to host on connection. 2024-06-04 17:49:19 +10:00