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).

This commit is contained in:
Louise Newberry 2016-02-22 22:02:45 +00:00
parent 20331cea64
commit 618ffd069d
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ size_t n = 0;
size_t USBSerial::write(const void *buf, uint32 len) {
size_t n = 0;
if (!this->isConnected() || !buf) {
if (!this->isConnected() || !usb_cdcacm_get_dtr() || !buf) {
return 0;
}