From 0d92c65829cc18ef40d221785c5a7c9f7fde0e8c Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 4 Sep 2018 18:36:08 +0700 Subject: [PATCH] correct disconnection check to only dtr --- ports/nrf/usb/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/usb/usb.c b/ports/nrf/usb/usb.c index f8b5fd6632..248d31e213 100644 --- a/ports/nrf/usb/usb.c +++ b/ports/nrf/usb/usb.c @@ -130,8 +130,8 @@ uint32_t tusb_hal_millis(void) { void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) { (void) itf; // interface ID, not used - // disconnected event - if ( !dtr && !rts ) + // DTR = false is counted as disconnected + if ( !dtr ) { cdc_line_coding_t coding; tud_cdc_get_line_coding(&coding);