mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-24 05:42:57 +08:00
Adapt to new control xfer callback
This commit is contained in:
parent
57058e33fc
commit
3158b323d8
@ -292,14 +292,6 @@ uint16_t ncmd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint1
|
||||
return drv_len;
|
||||
}
|
||||
|
||||
// Invoked when class request DATA stage is finished.
|
||||
bool ncmd_control_complete(uint8_t rhport, tusb_control_request_t const * request)
|
||||
{
|
||||
(void) rhport;
|
||||
(void) request;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ncm_report()
|
||||
{
|
||||
if (ncm_interface.report_state == REPORT_SPEED) {
|
||||
@ -317,8 +309,10 @@ static void ncm_report()
|
||||
|
||||
// Handle class control request
|
||||
// return false to stall control endpoint (e.g unsupported request)
|
||||
bool ncmd_control_request(uint8_t rhport, tusb_control_request_t const * request)
|
||||
bool ncmd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
|
||||
{
|
||||
if ( stage != CONTROL_STAGE_SETUP ) return true;
|
||||
|
||||
switch ( request->bmRequestType_bit.type )
|
||||
{
|
||||
case TUSB_REQ_TYPE_STANDARD:
|
||||
|
@ -77,8 +77,7 @@ void tud_ncm_link_state_cb(bool state);
|
||||
void ncmd_init (void);
|
||||
void ncmd_reset (uint8_t rhport);
|
||||
uint16_t ncmd_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
|
||||
bool ncmd_control_request (uint8_t rhport, tusb_control_request_t const * request);
|
||||
bool ncmd_control_complete (uint8_t rhport, tusb_control_request_t const * request);
|
||||
bool ncmd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
|
||||
bool ncmd_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -217,8 +217,7 @@ static usbd_class_driver_t const _usbd_driver[] =
|
||||
.init = ncmd_init,
|
||||
.reset = ncmd_reset,
|
||||
.open = ncmd_open,
|
||||
.control_request = ncmd_control_request,
|
||||
.control_complete = ncmd_control_complete,
|
||||
.control_xfer_cb = ncmd_control_xfer_cb,
|
||||
.xfer_cb = ncmd_xfer_cb,
|
||||
.sof = NULL
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user