Skip to content

Commit 1f13f47

Browse files
committed
The previous fix should probably be in is connected rather than the write function so moving it there.
1 parent 618ffd0 commit 1f13f47

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

STM32F1/cores/maple/usb_serial.cpp

Lines changed: 2 additions & 2 deletions
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() || !usb_cdcacm_get_dtr() || !buf) {
109+
if (!this->isConnected() || !buf) {
110110
return 0;
111111
}
112112

@@ -199,7 +199,7 @@ uint8 USBSerial::pending(void) {
199199
}
200200

201201
uint8 USBSerial::isConnected(void) {
202-
return usb_is_connected(USBLIB) && usb_is_configured(USBLIB);
202+
return usb_is_connected(USBLIB) && usb_is_configured(USBLIB) && usb_cdcacm_get_dtr();
203203
}
204204

205205
uint8 USBSerial::getDTR(void) {

0 commit comments

Comments
 (0)