usb_cdcacm: add flush method to wait for empty buffer
This commit is contained in:
parent
86ad8ea7ef
commit
60a1859008
|
@ -479,7 +479,13 @@ void usb_cdcacm_putchar(char c)
|
|||
usb_cdcacm_data_tx_cb(NULL, 0); // send data over USB when possible
|
||||
}
|
||||
|
||||
void usb_cdcacm_flush(void)
|
||||
{
|
||||
while (tx_used);
|
||||
}
|
||||
|
||||
/** USB interrupt service routine called when data is received */
|
||||
void usb_lp_can_rx0_isr(void) {
|
||||
void usb_lp_can_rx0_isr(void)
|
||||
{
|
||||
usbd_poll(usb_device);
|
||||
}
|
||||
|
|
|
@ -16,3 +16,6 @@ void usb_cdcacm_setup(void);
|
|||
* @note blocks if transmit buffer is full, else puts in buffer and returns
|
||||
*/
|
||||
void usb_cdcacm_putchar(char c);
|
||||
/** wait until all is transmitted (blocking)
|
||||
*/
|
||||
void usb_cdcacm_flush(void);
|
||||
|
|
Loading…
Reference in New Issue