diff options
| author | foamyguy <foamyguy@gmail.com> | 2020-11-08 18:32:15 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-08 18:32:15 -0600 |
| commit | cf21c4da601e00a614efd8ade774a0c8e5444c64 (patch) | |
| tree | 118a157edbc1884f502de8e9e26f79d178ed8c9a /supervisor/shared/serial.c | |
| parent | 7611e71a1bc49bcb426e0854519d5143eb262a17 (diff) | |
| parent | eec9821fdc19ca81c2d0811a6b6c5909a54b8c81 (diff) | |
Merge pull request #1 from adafruit/main
merge from adafruit
Diffstat (limited to 'supervisor/shared/serial.c')
| -rw-r--r-- | supervisor/shared/serial.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 303f89e75..7383cc228 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -69,7 +69,9 @@ bool serial_connected(void) { #if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) return true; #else - return tud_cdc_connected(); + // True if DTR is asserted, and the USB connection is up. + // tud_cdc_get_line_state(): bit 0 is DTR, bit 1 is RTS + return (tud_cdc_get_line_state() & 1) && tud_ready(); #endif } |
