diff --git a/lib/usb_cdcacm.c b/lib/usb_cdcacm.c index 9314fc0..d4a34a9 100644 --- a/lib/usb_cdcacm.c +++ b/lib/usb_cdcacm.c @@ -403,7 +403,9 @@ void cdcacm_putchar(char c) tx_buffer[(tx_i+tx_used)%LENGTH(tx_buffer)] = c; // overwrite old data } mutex_unlock(&tx_lock); // release lock - usbd_ep_write_packet(usb_device, 0x82, NULL, 0); // trigger tx callback + if (tx_used==1) { // to buffer is not empty anymore + usbd_ep_write_packet(usb_device, 0x82, NULL, 0); // trigger tx callback + } } /** @brief USB interrupt service routine called when data is received */