summaryrefslogtreecommitdiff
path: root/src/device/usbd_pvt.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/device/usbd_pvt.h')
-rw-r--r--src/device/usbd_pvt.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/device/usbd_pvt.h b/src/device/usbd_pvt.h
index 44310f022..1d60e5ae2 100644
--- a/src/device/usbd_pvt.h
+++ b/src/device/usbd_pvt.h
@@ -51,10 +51,21 @@ typedef struct
void (* sof ) (uint8_t rhport); /* optional */
} usbd_class_driver_t;
+#if !defined(TU_HAS_NO_ATTR_WEAK)
// Invoked when initializing device stack to get additional class drivers.
// Can optionally implemented by application to extend/overwrite class driver support.
// Note: The drivers array must be accessible at all time when stack is active
usbd_class_driver_t const* usbd_app_driver_get_cb(uint8_t* driver_count) TU_ATTR_WEAK;
+#else
+ #if ADD_WEAK_FUNC_USBD_APP_DRIVER_GET_CB
+ #define USBD_APP_DRIVER_GET_CB usbd_app_driver_get_cb
+ #endif
+ #ifndef USBD_APP_DRIVER_GET_CB
+ #define USBD_APP_DRIVER_GET_CB NULL
+ #else
+ extern usbd_class_driver_t const* USBD_APP_DRIVER_GET_CB(uint8_t* driver_count);
+ #endif
+#endif
typedef bool (*usbd_control_xfer_cb_t)(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);