fix double USB transmit
This commit is contained in:
parent
72b3d5188b
commit
715bfd784d
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue