File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
examples/dual/host_info_to_device_cdc/src Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ ContinuationIndentWidth: 2
6565ColumnLimit : 120
6666ConstructorInitializerAllOnOneLineOrOnePerLine : false
6767Cpp11BracedListStyle : true
68+ IncludeBlocks : Preserve
6869IncludeCategories :
6970 - Regex : ' ^<.*'
7071 Priority : 1
Original file line number Diff line number Diff 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
208211void 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 ]) {
You can’t perform that action at this time.
0 commit comments