summaryrefslogtreecommitdiff
path: root/src/device/usbd.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-09-29 15:32:08 +0700
committerhathach <[email protected]>2025-09-29 15:32:08 +0700
commitbdd557caf14b8987729fd73f11ccef7a29e7045d (patch)
tree881b6aa1361903e6d75a465e55b109468bfd86ab /src/device/usbd.c
parent4f3a5f92fa21307b1f1c9700cd041e945a627f63 (diff)
parent5130850337c1e8e0eedfa2d7165413de27ff6d2f (diff)
Merge branch 'master' into fork/ennebi/mtp
Diffstat (limited to 'src/device/usbd.c')
-rw-r--r--src/device/usbd.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index e5542914a..339ccf4b4 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -407,6 +407,18 @@ void usbd_control_set_request(tusb_control_request_t const *request);
void usbd_control_set_complete_callback( usbd_control_xfer_cb_t fp );
bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
+//--------------------------------------------------------------------+
+// Weak stubs: invoked if no strong implementation is available
+//--------------------------------------------------------------------+
+TU_ATTR_WEAK usbd_class_driver_t const* usbd_app_driver_get_cb(uint8_t* driver_count) {
+ *driver_count = 0;
+ return NULL;
+}
+
+TU_ATTR_WEAK bool dcd_edpt_xfer_fifo(uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes) {
+ (void) rhport; (void) ep_addr; (void) ff; (void) total_bytes;
+ return false;
+}
//--------------------------------------------------------------------+
// Debug
@@ -530,10 +542,8 @@ bool tud_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
TU_ASSERT(_usbd_q);
// Get application driver if available
- if (usbd_app_driver_get_cb) {
- _app_driver = usbd_app_driver_get_cb(&_app_driver_count);
- TU_ASSERT(_app_driver_count + BUILTIN_DRIVER_COUNT <= UINT8_MAX);
- }
+ _app_driver = usbd_app_driver_get_cb(&_app_driver_count);
+ TU_ASSERT(_app_driver_count + BUILTIN_DRIVER_COUNT <= UINT8_MAX);
// Init class drivers
for (uint8_t i = 0; i < TOTAL_DRIVER_COUNT; i++) {