Skip to content

Commit bb3117c

Browse files
committed
Remove redundant variable.
1 parent 0f8e7a2 commit bb3117c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
USBD_HandleTypeDef hUSBD_Device_CDC;
3838

3939
static bool CDC_initialized = false;
40-
static bool hostPortOpen = false;
4140

4241
/* Received Data over USB are stored in this buffer */
4342
CDC_TransmitQueue_TypeDef TransmitQueue;
@@ -170,7 +169,6 @@ static int8_t USBD_CDC_Control(uint8_t cmd, uint8_t *pbuf, uint16_t length)
170169
case CDC_SET_CONTROL_LINE_STATE:
171170
lineState =
172171
(((USBD_SetupReqTypedef *)pbuf)->wValue & 0x01) != 0; // Check DTR state
173-
hostPortOpen = lineState;
174172
break;
175173

176174
case CDC_SEND_BREAK:
@@ -249,7 +247,7 @@ void CDC_deInit(void)
249247

250248
bool CDC_connected()
251249
{
252-
return hUSBD_Device_CDC.dev_state == USBD_STATE_CONFIGURED && hostPortOpen;
250+
return hUSBD_Device_CDC.dev_state == USBD_STATE_CONFIGURED && lineState;
253251
}
254252

255253
void CDC_continue_transmit(void)

0 commit comments

Comments
 (0)