diff --git a/hardware/arduino/cores/arduino/CDC.cpp b/hardware/arduino/cores/arduino/CDC.cpp index aae91c22137..91947bd15d3 100644 --- a/hardware/arduino/cores/arduino/CDC.cpp +++ b/hardware/arduino/cores/arduino/CDC.cpp @@ -61,6 +61,14 @@ int WEAK CDC_GetInterface(u8* interfaceNum) return USB_SendControl(TRANSFER_PGM,&_cdcInterface,sizeof(_cdcInterface)); } +void WEAK lineCodingEvent(long baud, byte databits, byte parity, byte charFormat) +{ +} + +void WEAK lineStateEvent(byte linestate) +{ +} + bool WEAK CDC_Setup(Setup& setup) { u8 r = setup.bRequest; @@ -80,6 +88,10 @@ bool WEAK CDC_Setup(Setup& setup) if (CDC_SET_LINE_CODING == r) { USB_RecvControl((void*)&_usbLineInfo,7); + lineCodingEvent(_usbLineInfo.dwDTERate, + _usbLineInfo.bDataBits, + _usbLineInfo.bParityType, + _usbLineInfo.bCharFormat); return true; } @@ -87,6 +99,8 @@ bool WEAK CDC_Setup(Setup& setup) { _usbLineInfo.lineState = setup.wValueL; + lineStateEvent(_usbLineInfo.lineState); + // auto-reset into the bootloader is triggered when the port, already // open at 1200 bps, is closed. this is the signal to start the watchdog // with a relatively long period so it can finish housekeeping tasks