Skip to content

Commit 618ffd0

Browse files
committed
Check USB DTR is active before sending data down the USB port (this should only be active when the port is connected to a terminal).
1 parent 20331ce commit 618ffd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

STM32F1/cores/maple/usb_serial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ size_t n = 0;
106106

107107
size_t USBSerial::write(const void *buf, uint32 len) {
108108
size_t n = 0;
109-
if (!this->isConnected() || !buf) {
109+
if (!this->isConnected() || !usb_cdcacm_get_dtr() || !buf) {
110110
return 0;
111111
}
112112

0 commit comments

Comments
 (0)