Revert "cdc_acm : Restrict writing more than 4 bytes into TX USB Endpoint."

This reverts commit 1da0a9eebd.

The workaround caused a severe performance penalty, and only worked
for USB packets of 4-15 bytes in length (16+ byte packets weren't
subject to the hardware bug).  Single-byte packets (very common for
cdc_acm serial port transfers) would still be duplicated sometimes.

The upcoming DMA implementation does not share the performance
penalty, and also is not subject to the bug for those sizes of packets
(though it DOES still have a problem with single-byte packets!).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2017-05-25 08:54:00 -07:00 committed by Anas Nashif
parent e6874a0c61
commit 4a8a24fe39

View File

@ -41,25 +41,12 @@ static void interrupt_handler(struct device *dev)
static void write_data(struct device *dev, const char *buf, int len)
{
int sent;
uart_irq_tx_enable(dev);
while (len) {
data_transmitted = false;
sent = uart_fifo_fill(dev, (const u8_t *)buf, len);
if (!sent) {
printf("Unable to send Data !\n");
break;
}
/* Wait until Tx interrupr is generated*/
while (data_transmitted == false)
;
/* Update remainging Data length to transfer*/
len -= sent;
buf += sent;
}
data_transmitted = false;
uart_fifo_fill(dev, (const u8_t *)buf, len);
while (data_transmitted == false)
;
uart_irq_tx_disable(dev);
}