arpruss / USBComposite_stm32f1

USB Composite library for STM32F1 (HID, Serial, MIDI and XBox360 controller)
Other
381 stars 76 forks source link

Wrong USBCompositeSerial::flush() realisation #70

Open Allexin opened 4 years ago

Allexin commented 4 years ago
void USBCompositeSerial::flush(void)
{
/*Roger Clark. Rather slow method. Need to improve this */
    uint8 b;
    while(composite_cdcacm_data_available())
    {
        this->read(&b, 1);
    }
    return;
}

flush - must wait while TX channel is not empty. But here we simple wipe out all data from RX channel.