Skip to content

Commit 08f932a

Browse files
committed
Also check the DTR value, when deciding to drop data.
1 parent 85bc9b0 commit 08f932a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ void CDC_deInit(void)
245245
}
246246
}
247247

248-
uint8_t CDC_connected()
248+
bool CDC_connected()
249249
{
250-
return hUSBD_Device_CDC.dev_state == USBD_STATE_CONFIGURED;
250+
return hUSBD_Device_CDC.dev_state == USBD_STATE_CONFIGURED && lineState;
251251
}
252252

253253
void CDC_continue_transmit(void)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void CDC_continue_transmit(void);
5050
void CDC_resume_receive(void);
5151
void CDC_init(void);
5252
void CDC_deInit(void);
53-
uint8_t CDC_connected();
53+
bool CDC_connected();
5454

5555
#ifdef __cplusplus
5656
}

0 commit comments

Comments
 (0)