fix double USB transmit

This commit is contained in:
King Kévin 2016-04-17 12:11:12 +02:00
parent 72b3d5188b
commit 715bfd784d
1 changed files with 3 additions and 1 deletions

View File

@ -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 */