diff --git a/bsp/at32/libraries/rt_drivers/drv_usbd.c b/bsp/at32/libraries/rt_drivers/drv_usbd.c index 25541f85fb..ef9cb8ddd8 100644 --- a/bsp/at32/libraries/rt_drivers/drv_usbd.c +++ b/bsp/at32/libraries/rt_drivers/drv_usbd.c @@ -10,14 +10,14 @@ #include #include -#include "usbd_int.h" #include "drv_common.h" + +#if defined(BSP_USING_USBD) +#include "usbd_int.h" #include "drv_usbd.h" #include "drv_config.h" -#if defined(BSP_USING_USBD) - -static struct at32_usbd *p_usbd_instance = NULL; +static struct at32_usbd *p_usbd_instance = RT_NULL; static struct ep_id endpoint_pool[] = { {0x0, USB_EP_ATTR_CONTROL, USB_DIR_INOUT, 64, ID_ASSIGNED }, diff --git a/bsp/at32/libraries/rt_drivers/drv_usbd.h b/bsp/at32/libraries/rt_drivers/drv_usbd.h index 5406537026..37d9c5d952 100644 --- a/bsp/at32/libraries/rt_drivers/drv_usbd.h +++ b/bsp/at32/libraries/rt_drivers/drv_usbd.h @@ -14,6 +14,8 @@ #include #include #include "drv_common.h" + +#if defined(BSP_USING_USBD) #include "usbd_core.h" struct at32_usbd { @@ -21,7 +23,7 @@ struct at32_usbd { usbd_core_type *p_usbd_core; IRQn_Type irqn; }; - +#endif #endif /* __DRV_USBD_H__ */ /******************* end of file *******************/ diff --git a/bsp/at32/libraries/rt_drivers/drv_usbfs.h b/bsp/at32/libraries/rt_drivers/drv_usbfs.h index 52d205da27..bff0b598ee 100644 --- a/bsp/at32/libraries/rt_drivers/drv_usbfs.h +++ b/bsp/at32/libraries/rt_drivers/drv_usbfs.h @@ -14,6 +14,9 @@ #include #include #include "drv_common.h" + +#if defined(BSP_USING_HOST_USBFS1) || defined(BSP_USING_HOST_USBFS2) || \ + defined(BSP_USING_DEVICE_USBFS1) || defined(BSP_USING_DEVICE_USBFS2) #include "usb_core.h" struct at32_usbfs { @@ -22,7 +25,7 @@ struct at32_usbfs { otg_id_type id; IRQn_Type irqn; }; - +#endif #endif /* __DRV_USBFS_H__ */ /******************* end of file *******************/ diff --git a/bsp/at32/libraries/rt_drivers/drv_usbfsd.c b/bsp/at32/libraries/rt_drivers/drv_usbfsd.c index 494db5dabc..00764e44d3 100644 --- a/bsp/at32/libraries/rt_drivers/drv_usbfsd.c +++ b/bsp/at32/libraries/rt_drivers/drv_usbfsd.c @@ -10,14 +10,14 @@ #include #include -#include "usbd_int.h" #include "drv_common.h" + +#if defined(BSP_USING_DEVICE_USBFS1) || defined(BSP_USING_DEVICE_USBFS2) +#include "usbd_int.h" #include "drv_usbfs.h" #include "drv_config.h" -#if defined(BSP_USING_DEVICE_USBFS1) || defined(BSP_USING_DEVICE_USBFS2) - -static struct at32_usbfs *p_usbfs_instance = NULL; +static struct at32_usbfs *p_usbfs_instance = RT_NULL; static struct ep_id endpoint_pool[] = { {0x0, USB_EP_ATTR_CONTROL, USB_DIR_INOUT, 64, ID_ASSIGNED }, @@ -196,7 +196,7 @@ static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) static rt_err_t _ep0_send_status(void) { - usbd_ept_send(&p_usbfs_instance->p_otg_core->dev, 0x00, NULL, 0); + usbd_ept_send(&p_usbfs_instance->p_otg_core->dev, 0x00, RT_NULL, 0); return RT_EOK; } diff --git a/bsp/at32/libraries/rt_drivers/drv_usbfsh.c b/bsp/at32/libraries/rt_drivers/drv_usbfsh.c index 8a959cff81..95604c2458 100644 --- a/bsp/at32/libraries/rt_drivers/drv_usbfsh.c +++ b/bsp/at32/libraries/rt_drivers/drv_usbfsh.c @@ -10,12 +10,12 @@ #include #include -#include "usbh_int.h" #include "drv_common.h" -#include "drv_usbfs.h" -#include "drv_config.h" #if defined(BSP_USING_HOST_USBFS1) || defined(BSP_USING_HOST_USBFS2) +#include "usbh_int.h" +#include "drv_usbfs.h" +#include "drv_config.h" //#define DRV_DEBUG #define LOG_TAG "drv.usb" @@ -23,7 +23,7 @@ static struct rt_completion urb_completion; static volatile rt_bool_t connect_status = RT_FALSE; -static struct at32_usbfs *p_usbfs_instance = NULL; +static struct at32_usbfs *p_usbfs_instance = RT_NULL; enum { diff --git a/bsp/at32/libraries/usbd_library/inc/usb_std.h b/bsp/at32/libraries/usbd_library/inc/usb_std.h index 6f5f2983db..9fa002f60a 100644 --- a/bsp/at32/libraries/usbd_library/inc/usb_std.h +++ b/bsp/at32/libraries/usbd_library/inc/usb_std.h @@ -240,6 +240,16 @@ typedef struct #define SWAPBYTE(addr) (uint16_t)(((uint16_t)(*((uint8_t *)(addr)))) + \ (((uint16_t)(*(((uint8_t *)(addr)) + 1))) << 8)) /*!< swap address */ +/** + * @brief min and max define + */ +#ifndef MIN +#define MIN(a, b) (uint16_t)(((a) < (b)) ? (a) : (b)) /*!< min define*/ +#endif +#ifndef MAX +#define MAX(a, b) (uint16_t)(((a) > (b)) ? (a) : (b)) /*!< max define*/ +#endif + /** * @brief low byte and high byte define */ diff --git a/bsp/at32/libraries/usbd_library/inc/usbd_core.h b/bsp/at32/libraries/usbd_library/inc/usbd_core.h index ba479f8078..f7dc7981d6 100644 --- a/bsp/at32/libraries/usbd_library/inc/usbd_core.h +++ b/bsp/at32/libraries/usbd_library/inc/usbd_core.h @@ -40,6 +40,8 @@ extern "C" { * @{ */ +#ifdef BSP_USING_USBD + /** * @brief usb device event */ @@ -164,6 +166,7 @@ void usbd_core_init(usbd_core_type *udev, usb_reg_type *usb_reg, uint8_t core_id); +#endif /** * @} diff --git a/bsp/at32/libraries/usbd_library/inc/usbd_int.h b/bsp/at32/libraries/usbd_library/inc/usbd_int.h index 6723db625a..d3b0663243 100644 --- a/bsp/at32/libraries/usbd_library/inc/usbd_int.h +++ b/bsp/at32/libraries/usbd_library/inc/usbd_int.h @@ -40,6 +40,9 @@ extern "C" { /** @defgroup USBD_int_exported_functions * @{ */ + +#ifdef BSP_USING_USBD + void usbd_irq_handler(usbd_core_type *udev); void usbd_ept_loop_handler(usbd_core_type *udev); void usbd_eptn_handler(usbd_core_type *udev, usb_ept_number_type ept_num); @@ -57,6 +60,8 @@ void usbd_data_out_stage_callback(usbd_core_type *udev, uint32_t ept_num); void usbd_connectCallback(usbd_core_type *udev); void usbd_disconnectCallback(usbd_core_type *udev); +#endif + /** * @} */ diff --git a/bsp/at32/libraries/usbd_library/inc/usbd_sdr.h b/bsp/at32/libraries/usbd_library/inc/usbd_sdr.h index d5d588a327..9c2e666b7c 100644 --- a/bsp/at32/libraries/usbd_library/inc/usbd_sdr.h +++ b/bsp/at32/libraries/usbd_library/inc/usbd_sdr.h @@ -41,11 +41,14 @@ extern "C" { * @{ */ +#ifdef BSP_USING_USBD + void usbd_setup_request_parse(usb_setup_type *setup, uint8_t *buf); usb_sts_type usbd_device_request(usbd_core_type *udev); usb_sts_type usbd_interface_request(usbd_core_type *udev); usb_sts_type usbd_endpoint_request(usbd_core_type *udev); +#endif /** * @} diff --git a/bsp/at32/libraries/usbd_library/src/usbd_core.c b/bsp/at32/libraries/usbd_library/src/usbd_core.c index b6bd0ca9c4..0c19b2c031 100644 --- a/bsp/at32/libraries/usbd_library/src/usbd_core.c +++ b/bsp/at32/libraries/usbd_library/src/usbd_core.c @@ -35,6 +35,8 @@ * @{ */ +#ifdef BSP_USING_USBD + /** * @brief usb core in transfer complete handler * @param udev: to the structure of usbd_core_type @@ -679,6 +681,8 @@ void usbd_core_init(usbd_core_type *udev, usb_dev_init(udev->usb_reg); } +#endif + /** * @} */ diff --git a/bsp/at32/libraries/usbd_library/src/usbd_int.c b/bsp/at32/libraries/usbd_library/src/usbd_int.c index 4684d576ad..09add2bde1 100644 --- a/bsp/at32/libraries/usbd_library/src/usbd_int.c +++ b/bsp/at32/libraries/usbd_library/src/usbd_int.c @@ -33,6 +33,8 @@ * @{ */ +#ifdef BSP_USING_USBD + /** * @brief usb device interrput request handler. * @param udev: to the structure of usbd_core_type @@ -309,34 +311,36 @@ void usbd_wakeup_handler(usbd_core_type *udev) /* user define wakeup event */ } -__weak void usbd_reset_callback(usbd_core_type *udev) +RT_WEAK void usbd_reset_callback(usbd_core_type *udev) { } -__weak void usbd_setup_phase_done_callback(usbd_core_type *udev) +RT_WEAK void usbd_setup_phase_done_callback(usbd_core_type *udev) { } -__weak void usbd_data_in_stage_callback(usbd_core_type *udev, uint32_t ept_num) +RT_WEAK void usbd_data_in_stage_callback(usbd_core_type *udev, uint32_t ept_num) { } -__weak void usbd_sof_callback(usbd_core_type *udev) +RT_WEAK void usbd_sof_callback(usbd_core_type *udev) { } -__weak void usbd_data_out_stage_callback(usbd_core_type *udev, uint32_t ept_num) +RT_WEAK void usbd_data_out_stage_callback(usbd_core_type *udev, uint32_t ept_num) { } -__weak void usbd_connectCallback(usbd_core_type *udev) +RT_WEAK void usbd_connectCallback(usbd_core_type *udev) { } -__weak void usbd_disconnectCallback(usbd_core_type *udev) +RT_WEAK void usbd_disconnectCallback(usbd_core_type *udev) { } +#endif + /** * @} */ diff --git a/bsp/at32/libraries/usbd_library/src/usbd_sdr.c b/bsp/at32/libraries/usbd_library/src/usbd_sdr.c index 3ddf0afac8..3b9ce50497 100644 --- a/bsp/at32/libraries/usbd_library/src/usbd_sdr.c +++ b/bsp/at32/libraries/usbd_library/src/usbd_sdr.c @@ -33,6 +33,8 @@ * @{ */ +#ifdef BSP_USING_USBD + static usb_sts_type usbd_get_descriptor(usbd_core_type *udev); static usb_sts_type usbd_set_address(usbd_core_type *udev); static usb_sts_type usbd_get_status(usbd_core_type *udev); @@ -66,10 +68,10 @@ static usb_sts_type usbd_get_descriptor(usbd_core_type *udev) usb_sts_type ret = USB_OK; uint16_t len = 0; uint8_t desc_type = udev->setup.wValue >> 8; - usbd_desc_t *desc = NULL, usbd_desc = + usbd_desc_t *desc = RT_NULL, usbd_desc = { .length = 0xA, - .descriptor = NULL, + .descriptor = RT_NULL, }; switch(desc_type) @@ -108,7 +110,7 @@ static usb_sts_type usbd_get_descriptor(usbd_core_type *udev) return ret; } - if(desc != NULL) + if(desc != RT_NULL) { if((desc->length != 0) && (udev->setup.wLength != 0)) { @@ -523,6 +525,8 @@ usb_sts_type usbd_endpoint_request(usbd_core_type *udev) return ret; } +#endif + /** * @} */ diff --git a/bsp/at32/libraries/usbfs_library/inc/usb_std.h b/bsp/at32/libraries/usbfs_library/inc/usb_std.h index 9cf57cf988..9a62285af1 100644 --- a/bsp/at32/libraries/usbfs_library/inc/usb_std.h +++ b/bsp/at32/libraries/usbfs_library/inc/usb_std.h @@ -239,6 +239,16 @@ typedef struct #define SWAPBYTE(addr) (uint16_t)(((uint16_t)(*((uint8_t *)(addr)))) + \ (((uint16_t)(*(((uint8_t *)(addr)) + 1))) << 8)) /*!< swap address */ +/** + * @brief min and max define + */ +#ifndef MIN +#define MIN(a, b) (uint16_t)(((a) < (b)) ? (a) : (b)) /*!< min define*/ +#endif +#ifndef MAX +#define MAX(a, b) (uint16_t)(((a) > (b)) ? (a) : (b)) /*!< max define*/ +#endif + /** * @brief low byte and high byte define */ diff --git a/bsp/at32/libraries/usbfs_library/inc/usbd_int.h b/bsp/at32/libraries/usbfs_library/inc/usbd_int.h index 95f645ee59..db208587a1 100644 --- a/bsp/at32/libraries/usbfs_library/inc/usbd_int.h +++ b/bsp/at32/libraries/usbfs_library/inc/usbd_int.h @@ -34,8 +34,6 @@ extern "C" { #include "usbd_core.h" #include "usb_core.h" -#ifdef USE_OTG_DEVICE_MODE - /** @addtogroup USBD_drivers_int * @{ */ @@ -44,6 +42,8 @@ extern "C" { * @{ */ +#ifdef USE_OTG_DEVICE_MODE + void usbd_irq_handler(otg_core_type *udev); void usbd_ept_handler(usbd_core_type *udev); void usbd_reset_handler(usbd_core_type *udev); @@ -68,6 +68,8 @@ void usbd_data_out_stage_callback(usbd_core_type *udev, uint32_t ept_num); void usbd_connectCallback(usbd_core_type *udev); void usbd_disconnectCallback(usbd_core_type *udev); +#endif + /** * @} */ @@ -81,5 +83,3 @@ void usbd_disconnectCallback(usbd_core_type *udev); #endif #endif - -#endif diff --git a/bsp/at32/libraries/usbfs_library/inc/usbd_sdr.h b/bsp/at32/libraries/usbfs_library/inc/usbd_sdr.h index a95e67a475..ffe61bface 100644 --- a/bsp/at32/libraries/usbfs_library/inc/usbd_sdr.h +++ b/bsp/at32/libraries/usbfs_library/inc/usbd_sdr.h @@ -33,8 +33,6 @@ extern "C" { /* includes ------------------------------------------------------------------*/ #include "usb_core.h" -#ifdef USE_OTG_DEVICE_MODE - /** @addtogroup USBD_drivers_standard_request * @{ */ @@ -43,11 +41,15 @@ extern "C" { * @{ */ +#ifdef USE_OTG_DEVICE_MODE + void usbd_setup_request_parse(usb_setup_type *setup, uint8_t *buf); usb_sts_type usbd_device_request(usbd_core_type *udev); usb_sts_type usbd_interface_request(usbd_core_type *udev); usb_sts_type usbd_endpoint_request(usbd_core_type *udev); +#endif + /** * @} */ @@ -61,5 +63,3 @@ usb_sts_type usbd_endpoint_request(usbd_core_type *udev); #endif #endif - -#endif diff --git a/bsp/at32/libraries/usbfs_library/inc/usbh_ctrl.h b/bsp/at32/libraries/usbfs_library/inc/usbh_ctrl.h index d96a448573..9f17dffa84 100644 --- a/bsp/at32/libraries/usbfs_library/inc/usbh_ctrl.h +++ b/bsp/at32/libraries/usbfs_library/inc/usbh_ctrl.h @@ -41,6 +41,8 @@ extern "C" { * @{ */ +#ifdef USE_OTG_HOST_MODE + usb_sts_type usbh_ctrl_send_setup(usbh_core_type *uhost, uint8_t *buffer, uint8_t hc_num); usb_sts_type usbh_ctrl_recv_data(usbh_core_type *uhost, uint8_t *buffer, uint16_t length, uint16_t hc_num); @@ -83,6 +85,8 @@ usb_sts_type usbh_set_feature(usbh_core_type *uhost, uint8_t feature, uint16_t i usb_sts_type usbh_clear_dev_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index); usb_sts_type usbh_clear_ept_feature(usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num); +#endif + /** * @} */ diff --git a/bsp/at32/libraries/usbfs_library/inc/usbh_int.h b/bsp/at32/libraries/usbfs_library/inc/usbh_int.h index fac3c575e5..2af37bae4e 100644 --- a/bsp/at32/libraries/usbfs_library/inc/usbh_int.h +++ b/bsp/at32/libraries/usbfs_library/inc/usbh_int.h @@ -42,6 +42,8 @@ extern "C" { * @{ */ +#ifdef USE_OTG_HOST_MODE + void usbh_irq_handler(otg_core_type *hdev); void usbh_hch_handler(usbh_core_type *uhost); void usbh_port_handler(usbh_core_type *uhost); @@ -55,6 +57,8 @@ void usbh_connect_callback(usbh_core_type *uhost); void usbh_disconnect_callback(usbh_core_type *uhost); void usbd_notify_urbchange_callback(usbh_core_type *uhost, uint8_t chnum, urb_sts_type sts); +#endif + /** * @} */ diff --git a/bsp/at32/libraries/usbfs_library/src/usbd_core.c b/bsp/at32/libraries/usbfs_library/src/usbd_core.c index 09a4259757..d6b4c9d9c0 100644 --- a/bsp/at32/libraries/usbfs_library/src/usbd_core.c +++ b/bsp/at32/libraries/usbfs_library/src/usbd_core.c @@ -859,12 +859,12 @@ usb_sts_type usbd_core_init(usbd_core_type *udev, } -/** - * @} - */ - -/** - * @} - */ - #endif + +/** + * @} + */ + +/** + * @} + */ diff --git a/bsp/at32/libraries/usbfs_library/src/usbd_int.c b/bsp/at32/libraries/usbfs_library/src/usbd_int.c index 3f69c1e850..34fe28d729 100644 --- a/bsp/at32/libraries/usbfs_library/src/usbd_int.c +++ b/bsp/at32/libraries/usbfs_library/src/usbd_int.c @@ -521,40 +521,40 @@ void usbd_wakeup_handler(usbd_core_type *udev) udev->class_handler->event_handler(udev, USBD_WAKEUP_EVENT); } -__weak void usbd_reset_callback(usbd_core_type *udev) +RT_WEAK void usbd_reset_callback(usbd_core_type *udev) { } -__weak void usbd_setup_phase_done_callback(usbd_core_type *udev) +RT_WEAK void usbd_setup_phase_done_callback(usbd_core_type *udev) { } -__weak void usbd_data_in_stage_callback(usbd_core_type *udev, uint32_t ept_num) +RT_WEAK void usbd_data_in_stage_callback(usbd_core_type *udev, uint32_t ept_num) { } -__weak void usbd_sof_callback(usbd_core_type *udev) +RT_WEAK void usbd_sof_callback(usbd_core_type *udev) { } -__weak void usbd_data_out_stage_callback(usbd_core_type *udev, uint32_t ept_num) +RT_WEAK void usbd_data_out_stage_callback(usbd_core_type *udev, uint32_t ept_num) { } -__weak void usbd_connectCallback(usbd_core_type *udev) +RT_WEAK void usbd_connectCallback(usbd_core_type *udev) { } -__weak void usbd_disconnectCallback(usbd_core_type *udev) +RT_WEAK void usbd_disconnectCallback(usbd_core_type *udev) { } -/** - * @} - */ - -/** - * @} - */ - #endif + +/** + * @} + */ + +/** + * @} + */ diff --git a/bsp/at32/libraries/usbfs_library/src/usbd_sdr.c b/bsp/at32/libraries/usbfs_library/src/usbd_sdr.c index 4630ba9177..a9ab559129 100644 --- a/bsp/at32/libraries/usbfs_library/src/usbd_sdr.c +++ b/bsp/at32/libraries/usbfs_library/src/usbd_sdr.c @@ -23,21 +23,17 @@ */ #include "usbd_sdr.h" -/** @addtogroup AT32F435_437_middlewares_usbd_drivers - * @{ - */ - /** @defgroup USBD_drivers_standard_request * @brief usb device standard_request * @{ */ -#ifdef USE_OTG_DEVICE_MODE - /** @defgroup USBD_sdr_private_functions * @{ */ +#ifdef USE_OTG_DEVICE_MODE + static usb_sts_type usbd_get_descriptor(usbd_core_type *udev); static usb_sts_type usbd_set_address(usbd_core_type *udev); static usb_sts_type usbd_get_status(usbd_core_type *udev); @@ -70,7 +66,7 @@ static usb_sts_type usbd_get_descriptor(usbd_core_type *udev) { usb_sts_type ret = USB_OK; uint16_t len = 0; - usbd_desc_t *desc = NULL; + usbd_desc_t *desc = RT_NULL; uint8_t desc_type = udev->setup.wValue >> 8; switch(desc_type) { @@ -120,7 +116,7 @@ static usb_sts_type usbd_get_descriptor(usbd_core_type *udev) return ret; } - if(desc != NULL) + if(desc != RT_NULL) { if((desc->length != 0) && (udev->setup.wLength != 0)) { @@ -520,16 +516,14 @@ usb_sts_type usbd_endpoint_request(usbd_core_type *udev) } return ret; } -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ #endif + +/** + * @} + */ + +/** + * @} + */ + diff --git a/bsp/at32/libraries/usbfs_library/src/usbh_core.c b/bsp/at32/libraries/usbfs_library/src/usbh_core.c index 00359130db..4cafbe4136 100644 --- a/bsp/at32/libraries/usbfs_library/src/usbh_core.c +++ b/bsp/at32/libraries/usbfs_library/src/usbh_core.c @@ -26,6 +26,8 @@ #include "usb_core.h" #include "usbh_ctrl.h" +#ifdef USE_OTG_HOST_MODE + /** @defgroup USBH_drivers_core * @brief usb host drivers core * @{ @@ -1105,7 +1107,7 @@ static void usbh_disconnect(usbh_core_type *uhost) } /* call class reset handler */ - if(uhost->class_handler->reset_handler != NULL) + if(uhost->class_handler->reset_handler != RT_NULL) { uhost->class_handler->reset_handler(uhost); } @@ -1220,3 +1222,4 @@ usb_sts_type usbh_loop_handler(usbh_core_type *uhost) * @} */ +#endif diff --git a/bsp/at32/libraries/usbfs_library/src/usbh_ctrl.c b/bsp/at32/libraries/usbfs_library/src/usbh_ctrl.c index 93dc655281..4dd4280fff 100644 --- a/bsp/at32/libraries/usbfs_library/src/usbh_ctrl.c +++ b/bsp/at32/libraries/usbfs_library/src/usbh_ctrl.c @@ -25,6 +25,8 @@ #include "usbh_core.h" #include "usb_std.h" +#ifdef USE_OTG_HOST_MODE + /** @defgroup USBH_drivers_control * @brief usb host drivers control * @{ @@ -956,3 +958,4 @@ usb_sts_type usbh_clear_ept_feature(usbh_core_type *uhost, uint8_t ept_num, uint * @} */ +#endif diff --git a/bsp/at32/libraries/usbfs_library/src/usbh_int.c b/bsp/at32/libraries/usbfs_library/src/usbh_int.c index 1b873eca86..886d22062e 100644 --- a/bsp/at32/libraries/usbfs_library/src/usbh_int.c +++ b/bsp/at32/libraries/usbfs_library/src/usbh_int.c @@ -23,6 +23,8 @@ */ #include "usbh_int.h" +#ifdef USE_OTG_HOST_MODE + /** @defgroup USBH_drivers_interrupt * @brief usb host interrupt * @{ @@ -518,15 +520,15 @@ void usbh_port_handler(usbh_core_type *uhost) usb_host->hprt = prt_0; } -__weak void usbh_connect_callback(usbh_core_type *uhost) +RT_WEAK void usbh_connect_callback(usbh_core_type *uhost) { } -__weak void usbh_disconnect_callback(usbh_core_type *uhost) +RT_WEAK void usbh_disconnect_callback(usbh_core_type *uhost) { } -__weak void usbd_notify_urbchange_callback(usbh_core_type *uhost, uint8_t chnum, urb_sts_type sts) +RT_WEAK void usbd_notify_urbchange_callback(usbh_core_type *uhost, uint8_t chnum, urb_sts_type sts) { } @@ -538,3 +540,4 @@ __weak void usbd_notify_urbchange_callback(usbh_core_type *uhost, uint8_t chnum, * @} */ +#endif