Skip to content

Commit

Permalink
add back weak callback for tud_vendor_control_xfer_cb due to conflict…
Browse files Browse the repository at this point in the history
… with arduino esp32
  • Loading branch information
hathach committed Aug 8, 2024
1 parent 7a32772 commit 9aaf9b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/device/usbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ TU_ATTR_WEAK void tud_suspend_cb(bool remote_wakeup_en) {
TU_ATTR_WEAK void tud_resume_cb(void) {
}

TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const* request) {
(void) rhport;
(void) stage;
(void) request;
return false;
}
//TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const* request) {
// (void) rhport;
// (void) stage;
// (void) request;
// return false;
//}

TU_ATTR_WEAK bool dcd_deinit(uint8_t rhport) {
(void) rhport;
Expand Down Expand Up @@ -715,6 +715,7 @@ static bool process_control_request(uint8_t rhport, tusb_control_request_t const

// Vendor request
if ( p_request->bmRequestType_bit.type == TUSB_REQ_TYPE_VENDOR ) {
TU_VERIFY(tud_vendor_control_xfer_cb);
usbd_control_set_complete_callback(tud_vendor_control_xfer_cb);
return tud_vendor_control_xfer_cb(rhport, CONTROL_STAGE_SETUP, p_request);
}
Expand Down
2 changes: 1 addition & 1 deletion src/device/usbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void tud_event_hook_cb(uint8_t rhport, uint32_t eventid, bool in_isr);
void tud_sof_cb(uint32_t frame_count);

// Invoked when received control request with VENDOR TYPE
bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);

//--------------------------------------------------------------------+
// Binary Device Object Store (BOS) Descriptor Templates
Expand Down

0 comments on commit 9aaf9b5

Please sign in to comment.