Skip to content

Commit

Permalink
fixed FTDI set control line
Browse files Browse the repository at this point in the history
  • Loading branch information
heikokue committed Mar 3, 2024
1 parent e6f9d71 commit 35f071f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/class/cdc/cdc_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
( CFG_TUH_CDC_RTS_CONTROL_ON_ENUM ? CDC_CONTROL_LINE_STATE_RTS : 0 ) )
#endif


//--------------------------------------------------------------------+
// Host CDC Interface
//--------------------------------------------------------------------+
Expand Down Expand Up @@ -1180,9 +1179,11 @@ static bool ftdi_set_data_request(cdch_interface_t * p_cdc, tuh_xfer_cb_t comple
}

static inline bool ftdi_update_mctrl(cdch_interface_t * p_cdc, tuh_xfer_cb_t complete_cb, uintptr_t user_data) {
// FTDI has the same bit coding
uint16_t value = (p_cdc->requested_line_state.dtr ? (uint16_t) FTDI_SIO_SET_DTR_HIGH : (uint16_t) FTDI_SIO_SET_DTR_LOW) |
(p_cdc->requested_line_state.rts ? (uint16_t) FTDI_SIO_SET_RTS_HIGH : (uint16_t) FTDI_SIO_SET_RTS_LOW);

return ftdi_set_request(p_cdc, FTDI_SIO_SET_MODEM_CTRL_REQUEST, FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE,
p_cdc->requested_line_state.all, p_cdc->ftdi.channel, complete_cb, user_data);
value, p_cdc->ftdi.channel, complete_cb, user_data);
}

//------------- Driver API -------------//
Expand Down

0 comments on commit 35f071f

Please sign in to comment.