@@ -323,7 +323,8 @@ bool tuh_cdc_set_control_line_state(uint8_t idx, uint16_t line_state, tuh_xfer_c
323
323
.user_data = user_data
324
324
};
325
325
326
- return tuh_control_xfer (& xfer );
326
+ TU_ASSERT (tuh_control_xfer (& xfer ));
327
+ return true;
327
328
}
328
329
329
330
bool tuh_cdc_set_line_coding (uint8_t idx , cdc_line_coding_t const * line_coding , tuh_xfer_cb_t complete_cb , uintptr_t user_data )
@@ -363,7 +364,8 @@ bool tuh_cdc_set_line_coding(uint8_t idx, cdc_line_coding_t const* line_coding,
363
364
.user_data = user_data
364
365
};
365
366
366
- return tuh_control_xfer (& xfer );
367
+ TU_ASSERT (tuh_control_xfer (& xfer ));
368
+ return true;
367
369
}
368
370
369
371
//--------------------------------------------------------------------+
@@ -543,26 +545,31 @@ static void process_cdc_config(tuh_xfer_t* xfer)
543
545
uintptr_t const state = xfer -> user_data ;
544
546
uint8_t const itf_num = (uint8_t ) tu_le16toh (xfer -> setup -> wIndex );
545
547
uint8_t const idx = tuh_cdc_itf_get_index (xfer -> daddr , itf_num );
546
- TU_ASSERT (idx != TUSB_INDEX_INVALID_8 , );
548
+ cdch_interface_t * p_cdc = get_itf (idx );
549
+ TU_ASSERT (p_cdc , );
547
550
548
551
switch (state )
549
552
{
550
553
case CONFIG_SET_CONTROL_LINE_STATE :
551
- #if CFG_TUH_CDC_LINE_CONTROL_ON_ENUM
552
- TU_ASSERT ( tuh_cdc_set_control_line_state (idx , CFG_TUH_CDC_LINE_CONTROL_ON_ENUM , process_cdc_config , CONFIG_SET_LINE_CODING ), );
553
- break ;
554
- #endif
555
- TU_ATTR_FALLTHROUGH ;
554
+ #if CFG_TUH_CDC_LINE_CONTROL_ON_ENUM
555
+ if (p_cdc -> acm_capability .support_line_request )
556
+ {
557
+ TU_ASSERT ( tuh_cdc_set_control_line_state (idx , CFG_TUH_CDC_LINE_CONTROL_ON_ENUM , process_cdc_config , CONFIG_SET_LINE_CODING ), );
558
+ break ;
559
+ }
560
+ #endif
561
+ TU_ATTR_FALLTHROUGH ;
556
562
557
563
case CONFIG_SET_LINE_CODING :
558
- #ifdef CFG_TUH_CDC_LINE_CODING_ON_ENUM
559
- {
560
- cdc_line_coding_t line_coding = CFG_TUH_CDC_LINE_CODING_ON_ENUM ;
561
- TU_ASSERT ( tuh_cdc_set_line_coding (idx , & line_coding , process_cdc_config , CONFIG_COMPLETE ), );
562
- break ;
563
- }
564
- #endif
565
- TU_ATTR_FALLTHROUGH ;
564
+ #ifdef CFG_TUH_CDC_LINE_CODING_ON_ENUM
565
+ if (p_cdc -> acm_capability .support_line_request )
566
+ {
567
+ cdc_line_coding_t line_coding = CFG_TUH_CDC_LINE_CODING_ON_ENUM ;
568
+ TU_ASSERT ( tuh_cdc_set_line_coding (idx , & line_coding , process_cdc_config , CONFIG_COMPLETE ), );
569
+ break ;
570
+ }
571
+ #endif
572
+ TU_ATTR_FALLTHROUGH ;
566
573
567
574
case CONFIG_COMPLETE :
568
575
if (tuh_cdc_mount_cb ) tuh_cdc_mount_cb (idx );
0 commit comments