Skip to content

Commit aac7ad1

Browse files
committed
cdc device tx_persistent for dual host info to help with hil test
1 parent 397a3af commit aac7ad1

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ ContinuationIndentWidth: 2
6565
ColumnLimit: 120
6666
ConstructorInitializerAllOnOneLineOrOnePerLine: false
6767
Cpp11BracedListStyle: true
68+
IncludeBlocks: Preserve
6869
IncludeCategories:
6970
- Regex: '^<.*'
7071
Priority: 1

examples/dual/host_info_to_device_cdc/src/main.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ static void usb_device_init(void) {
106106
.speed = TUSB_SPEED_AUTO
107107
};
108108
tusb_init(BOARD_TUD_RHPORT, &dev_init);
109+
tud_cdc_configure_t cdc_cfg = TUD_CDC_CONFIGURE_DEFAULT();
110+
cdc_cfg.tx_persistent = true;
111+
tud_cdc_configure(&cdc_cfg);
109112
board_init_after_tusb();
110113
}
111114

@@ -206,13 +209,6 @@ void tud_resume_cb(void) {
206209
}
207210

208211
void cdc_task(void) {
209-
if (!tud_cdc_connected()) {
210-
// delay a bit otherwise we can outpace host's terminal. Linux will set LineState (DTR) then Line Coding.
211-
// If we send data before Linux's terminal set Line Coding, it can be ignored --> missing data with hardware test loop
212-
tusb_time_delay_ms_api(20);
213-
return;
214-
}
215-
216212
for (uint8_t daddr = 1; daddr <= CFG_TUH_DEVICE_MAX; daddr++) {
217213
if (tuh_mounted(daddr)) {
218214
if (is_print[daddr]) {

0 commit comments

Comments
 (0)