Skip to content

Commit 3ff56cb

Browse files
committed
resolve conflict with arduino-esp32 bos descriptor and vendor control xfer
1 parent 10505ac commit 3ff56cb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/arduino/webusb/Adafruit_USBD_WebUSB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void Adafruit_USBD_WebUSB::flush(void) { tud_vendor_flush(); }
245245
//--------------------------------------------------------------------+
246246
extern "C" {
247247

248-
uint8_t const *tud_descriptor_bos_cb(void) { return desc_bos; }
248+
TU_ATTR_WEAK uint8_t const *tud_descriptor_bos_cb(void) { return desc_bos; }
249249

250250
// Invoked when a control transfer occurred on an interface of this class
251251
// Driver response accordingly to the request and the transfer stage

src/device/usbd.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ TU_ATTR_WEAK void tud_sof_cb(uint32_t frame_count) {
5353
(void) frame_count;
5454
}
5555

56-
TU_ATTR_WEAK uint8_t const* tud_descriptor_bos_cb(void) {
57-
return NULL;
58-
}
56+
// TU_ATTR_WEAK uint8_t const* tud_descriptor_bos_cb(void) {
57+
// return NULL;
58+
// }
5959

6060
TU_ATTR_WEAK uint8_t const* tud_descriptor_device_qualifier_cb(void) {
6161
return NULL;
@@ -79,10 +79,10 @@ TU_ATTR_WEAK void tud_suspend_cb(bool remote_wakeup_en) {
7979
TU_ATTR_WEAK void tud_resume_cb(void) {
8080
}
8181

82-
TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const* request) {
83-
(void) rhport; (void) stage; (void) request;
84-
return false;
85-
}
82+
// TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const* request) {
83+
// (void) rhport; (void) stage; (void) request;
84+
// return false;
85+
// }
8686

8787
TU_ATTR_WEAK bool dcd_deinit(uint8_t rhport) {
8888
(void) rhport;

src/device/usbd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid);
138138

139139
// Invoked when received GET BOS DESCRIPTOR request
140140
// Application return pointer to descriptor
141-
uint8_t const * tud_descriptor_bos_cb(void);
141+
TU_ATTR_WEAK uint8_t const * tud_descriptor_bos_cb(void);
142142

143143
// Invoked when received GET DEVICE QUALIFIER DESCRIPTOR request
144144
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete.
@@ -171,7 +171,7 @@ void tud_event_hook_cb(uint8_t rhport, uint32_t eventid, bool in_isr);
171171
void tud_sof_cb(uint32_t frame_count);
172172

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

176176
//--------------------------------------------------------------------+
177177
// Binary Device Object Store (BOS) Descriptor Templates

0 commit comments

Comments
 (0)