Skip to content

Commit 843fce7

Browse files
committed
USB: CDC: implement rts api
Signed-off-by: Frederic Pillon <[email protected]>
1 parent f04c66b commit 843fce7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: cores/arduino/USBSerial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ bool USBSerial::dtr(void)
188188

189189
bool USBSerial::rts(void)
190190
{
191-
return false;
191+
return rtsState;
192192
}
193193

194194
USBSerial::operator bool()

Diff for: cores/arduino/stm32/usb/cdc/usbd_cdc_if.c

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ static bool CDC_DTR_enabled = true;
5353
CDC_TransmitQueue_TypeDef TransmitQueue;
5454
CDC_ReceiveQueue_TypeDef ReceiveQueue;
5555
__IO bool dtrState = false; /* lineState */
56+
__IO bool rtsState = false;
5657
__IO bool receivePended = true;
5758
static uint32_t transmitStart = 0;
5859

@@ -190,6 +191,7 @@ static int8_t USBD_CDC_Control(uint8_t cmd, uint8_t *pbuf, uint16_t length)
190191
if (dtrState) { // Reset the transmit timeout when the port is connected
191192
transmitStart = 0;
192193
}
194+
rtsState = (((USBD_SetupReqTypedef *)pbuf)->wValue & CLS_RTS);
193195
#ifdef DTR_TOGGLING_SEQ
194196
dtr_toggling++; /* Count DTR toggling */
195197
#endif

0 commit comments

Comments
 (0)