USB Composite support
Dependents: mbed_cdc_hid_composite
Fork of USBDevice by
Diff: USBSerial/USBSerial.cpp
- Revision:
- 55:7c559fcb1d17
- Parent:
- 47:a0cd9646ecd1
diff -r 461d954eee6b -r 7c559fcb1d17 USBSerial/USBSerial.cpp --- a/USBSerial/USBSerial.cpp Fri May 22 08:45:47 2015 +0100 +++ b/USBSerial/USBSerial.cpp Sun May 31 15:36:50 2015 +0000 @@ -16,6 +16,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + #include "stdint.h" #include "USBSerial.h" @@ -33,7 +34,6 @@ return c; } - bool USBSerial::writeBlock(uint8_t * buf, uint16_t size) { if(size > MAX_PACKET_SIZE_EPBULK) { return false; @@ -46,18 +46,19 @@ -bool USBSerial::EPBULK_OUT_callback() { +bool USBSerial::EP_OUT_callback(void *_self) { + USBSerial *self = (USBSerial *)_self; uint8_t c[65]; uint32_t size = 0; //we read the packet received and put it on the circular buffer - readEP(c, &size); + self->readEP(c, &size); for (uint32_t i = 0; i < size; i++) { - buf.queue(c[i]); + self->buf.queue(c[i]); } //call a potential handler - rx.call(); + self->rx.call(); return true; }