diff --git a/features/unsupported/USBDevice/USBSerial/USBCDC.cpp b/features/unsupported/USBDevice/USBSerial/USBCDC.cpp index ec46f0fda3..ce48d32158 100644 --- a/features/unsupported/USBDevice/USBSerial/USBCDC.cpp +++ b/features/unsupported/USBDevice/USBSerial/USBCDC.cpp @@ -127,6 +127,10 @@ bool USBCDC::send(uint8_t * buffer, uint32_t size) { return USBDevice::write(EPBULK_IN, buffer, size, MAX_CDC_REPORT_SIZE); } +bool USBCDC::send_NB(uint8_t * buffer, uint32_t size) { + return USBDevice::writeNB(EPBULK_IN, buffer, size, MAX_CDC_REPORT_SIZE); +} + bool USBCDC::readEP(uint8_t * buffer, uint32_t * size) { if (!USBDevice::readEP(EPBULK_OUT, buffer, size, MAX_CDC_REPORT_SIZE)) return false; diff --git a/features/unsupported/USBDevice/USBSerial/USBCDC.h b/features/unsupported/USBDevice/USBSerial/USBCDC.h index 0f59c2c621..3cd3785d7e 100644 --- a/features/unsupported/USBDevice/USBSerial/USBCDC.h +++ b/features/unsupported/USBDevice/USBSerial/USBCDC.h @@ -70,7 +70,7 @@ protected: virtual const uint8_t * configurationDesc(); /* - * Send a buffer + * Send a buffer. Warning: blocking * * @param endpoint endpoint which will be sent the buffer * @param buffer buffer to be sent @@ -79,6 +79,16 @@ protected: */ bool send(uint8_t * buffer, uint32_t size); + /* + * Send a buffer. Warning: non blocking + * + * @param endpoint endpoint which will be sent the buffer + * @param buffer buffer to be sent + * @param size length of the buffer + * @returns true if successful + */ + bool send_NB(uint8_t * buffer, uint32_t size); + /* * Read a buffer from a certain endpoint. Warning: blocking *