From 68bfd048a54d1ff2def4cb1ee5285eacdb55f143 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 17 Mar 2022 12:53:52 +0700 Subject: change tuh_control_xfer_t struct --- src/class/cdc/cdc_host.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/class/cdc') diff --git a/src/class/cdc/cdc_host.c b/src/class/cdc/cdc_host.c index 8ca3dfbcb..9838df818 100644 --- a/src/class/cdc/cdc_host.c +++ b/src/class/cdc/cdc_host.c @@ -124,22 +124,24 @@ bool tuh_cdc_set_control_line_state(uint8_t dev_addr, bool dtr, bool rts, tuh_co { cdch_data_t const * p_cdc = get_itf(dev_addr); - tuh_control_xfer_t const xfer = + tusb_control_request_t const request = { - .request = + .bmRequestType_bit = { - .bmRequestType_bit = - { - .recipient = TUSB_REQ_RCPT_INTERFACE, - .type = TUSB_REQ_TYPE_CLASS, - .direction = TUSB_DIR_OUT - }, - .bRequest = CDC_REQUEST_SET_CONTROL_LINE_STATE, - .wValue = (rts ? 2 : 0) | (dtr ? 1 : 0), - .wIndex = p_cdc->itf_num, - .wLength = 0 + .recipient = TUSB_REQ_RCPT_INTERFACE, + .type = TUSB_REQ_TYPE_CLASS, + .direction = TUSB_DIR_OUT }, + .bRequest = CDC_REQUEST_SET_CONTROL_LINE_STATE, + .wValue = (rts ? 2 : 0) | (dtr ? 1 : 0), + .wIndex = p_cdc->itf_num, + .wLength = 0 + }; + tuh_control_xfer_t const xfer = + { + .ep_addr = 0, + .setup = &request, .buffer = NULL, .complete_cb = complete_cb, .user_arg = 0 -- cgit v1.3.1