diff options
| author | hathach <[email protected]> | 2025-11-13 13:56:02 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-11-13 13:56:02 +0700 |
| commit | aac7ad1eb682a86a5b67e638f9b91a5c2743d2f1 (patch) | |
| tree | 0555c9adf1fa3ba2dbafee2e3b80f5d1771ec4a4 /examples | |
| parent | 397a3af8afc4bc5460572da4a40629684dfa788c (diff) | |
cdc device tx_persistent for dual host info to help with hil test
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/dual/host_info_to_device_cdc/src/main.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/dual/host_info_to_device_cdc/src/main.c b/examples/dual/host_info_to_device_cdc/src/main.c index 03a1ac3d8..46e1d1ab2 100644 --- a/examples/dual/host_info_to_device_cdc/src/main.c +++ b/examples/dual/host_info_to_device_cdc/src/main.c @@ -106,6 +106,9 @@ static void usb_device_init(void) { .speed = TUSB_SPEED_AUTO }; tusb_init(BOARD_TUD_RHPORT, &dev_init); + tud_cdc_configure_t cdc_cfg = TUD_CDC_CONFIGURE_DEFAULT(); + cdc_cfg.tx_persistent = true; + tud_cdc_configure(&cdc_cfg); board_init_after_tusb(); } @@ -206,13 +209,6 @@ void tud_resume_cb(void) { } void cdc_task(void) { - if (!tud_cdc_connected()) { - // delay a bit otherwise we can outpace host's terminal. Linux will set LineState (DTR) then Line Coding. - // If we send data before Linux's terminal set Line Coding, it can be ignored --> missing data with hardware test loop - tusb_time_delay_ms_api(20); - return; - } - for (uint8_t daddr = 1; daddr <= CFG_TUH_DEVICE_MAX; daddr++) { if (tuh_mounted(daddr)) { if (is_print[daddr]) { |
