Skip to content

Commit b7e1f4c

Browse files
authored
Use tud_ready() instead of tud_cdc_connected()
tud_ready() - the device is ready to communicate. tud_cdc_connected() - DTR flag
1 parent bb28a3f commit b7e1f4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pico_sdk_sigrok/pico_sdk_sigrok.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ volatile bool mask_xfer_err;
6767
void my_stdio_usb_out_chars(const char *buf, int length) {
6868
static uint64_t last_avail_time;
6969
uint32_t owner;
70-
if (tud_cdc_connected()) {
70+
if (tud_ready()) {
7171
for (int i = 0; i < length;) {
7272
int n = length - i;
7373
int avail = (int) tud_cdc_write_available();
@@ -81,7 +81,7 @@ void my_stdio_usb_out_chars(const char *buf, int length) {
8181
} else {
8282
tud_task();
8383
tud_cdc_write_flush();
84-
if (!tud_cdc_connected() ||
84+
if (!tud_ready() ||
8585
(!tud_cdc_write_available() && time_us_64() > last_avail_time + PICO_STDIO_USB_STDOUT_TIMEOUT_US)) {
8686
break;
8787
}

0 commit comments

Comments
 (0)