From 636f803b7b3f41eb933ebbbccd3f5fc6fcd04ed7 Mon Sep 17 00:00:00 2001 From: Liu_Weichao Date: Tue, 8 Nov 2022 11:27:06 +0800 Subject: [PATCH] modify usb init position into board.c from init.c --- Ubiquitous/XiZi_IIoT/board/aiit-arm32-board/board.c | 8 ++++++++ Ubiquitous/XiZi_IIoT/board/ok1052-c/board.c | 10 ++++++++++ .../ok1052-c/third_party_driver/usb/connect_usb.c | 1 - .../XiZi_IIoT/board/stm32f407-st-discovery/board.c | 8 ++++++++ Ubiquitous/XiZi_IIoT/board/xidatong-arm32/board.c | 10 ++++++++++ .../third_party_driver/usb/connect_usb.c | 1 - Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/board.c | 10 ++++++++++ .../third_party_driver/usb/connect_usb.c | 1 - Ubiquitous/XiZi_IIoT/kernel/thread/init.c | 7 ------- 9 files changed, 46 insertions(+), 10 deletions(-) diff --git a/Ubiquitous/XiZi_IIoT/board/aiit-arm32-board/board.c b/Ubiquitous/XiZi_IIoT/board/aiit-arm32-board/board.c index 7a4460487..4e0688746 100644 --- a/Ubiquitous/XiZi_IIoT/board/aiit-arm32-board/board.c +++ b/Ubiquitous/XiZi_IIoT/board/aiit-arm32-board/board.c @@ -51,6 +51,8 @@ extern int HwSramInit(void); extern int Stm32HwAdcInit(void); extern int Stm32HwDacInit(void); extern int Stm32HwLcdInit(void); +extern int STM32USBHostRegister(void); +extern int Stm32HwUsbInit(void); static void ClockConfiguration() { @@ -147,6 +149,12 @@ struct InitSequenceDesc _board_init[] = #ifdef BSP_USING_SDIO {"hw sdcard init",HwSdioInit}, #endif +#ifdef BSP_USING_USB +#ifdef BSP_USING_STM32_USBH + { "STM32USBHostRegister", STM32USBHostRegister }, + { "hw usb", Stm32HwUsbInit }, +#endif +#endif #ifdef BSP_USING_EXTMEM { "hw extern sram", HwSramInit }, #endif diff --git a/Ubiquitous/XiZi_IIoT/board/ok1052-c/board.c b/Ubiquitous/XiZi_IIoT/board/ok1052-c/board.c index 5b1174a39..d891bfd50 100644 --- a/Ubiquitous/XiZi_IIoT/board/ok1052-c/board.c +++ b/Ubiquitous/XiZi_IIoT/board/ok1052-c/board.c @@ -59,6 +59,10 @@ extern int ExtSramInit(void); #include #endif +#ifdef BSP_USING_USB +#include +#endif + #ifdef BSP_USING_ADC #include #endif @@ -693,5 +697,11 @@ void InitBoardHardware() Imxrt1052HwSdioInit(); #endif +#ifdef BSP_USING_USB +#ifdef BSP_USING_NXP_USBH + Imxrt1052HwUsbHostInit(); +#endif +#endif + } diff --git a/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/usb/connect_usb.c b/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/usb/connect_usb.c index 28d4320f2..b86762899 100644 --- a/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/usb/connect_usb.c +++ b/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/usb/connect_usb.c @@ -28,7 +28,6 @@ Modification: #include #include -#define BSP_USING_NXP_USBH #ifdef BSP_USING_NXP_USBH /*! @brief USB host msd command instance global variable */ diff --git a/Ubiquitous/XiZi_IIoT/board/stm32f407-st-discovery/board.c b/Ubiquitous/XiZi_IIoT/board/stm32f407-st-discovery/board.c index f01d158d1..91a757661 100644 --- a/Ubiquitous/XiZi_IIoT/board/stm32f407-st-discovery/board.c +++ b/Ubiquitous/XiZi_IIoT/board/stm32f407-st-discovery/board.c @@ -50,6 +50,8 @@ extern int Stm32HwRtcInit(); extern int HwSdioInit(); extern int Stm32HwAdcInit(void); extern int Stm32HwDacInit(void); +extern int STM32USBHostRegister(void); +extern int Stm32HwUsbInit(void); #ifdef BSP_USING_LWIP extern int ETH_BSP_Config(); #endif @@ -139,6 +141,12 @@ struct InitSequenceDesc _board_init[] = #ifdef BSP_USING_SDIO {"hw sdcard init", HwSdioInit}, #endif +#ifdef BSP_USING_USB +#ifdef BSP_USING_STM32_USBH + { "STM32USBHostRegister", STM32USBHostRegister }, + { "hw usb", Stm32HwUsbInit }, +#endif +#endif #ifdef BSP_USING_ADC {"hw adc init", Stm32HwAdcInit}, #endif diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/board.c b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/board.c index 7c4e83381..1a64fc4f2 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/board.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/board.c @@ -56,6 +56,10 @@ Modification: #include #endif +#ifdef BSP_USING_USB +#include +#endif + #ifdef BSP_USING_WDT #include #endif @@ -303,6 +307,12 @@ struct InitSequenceDesc _board_init[] = { "sdio", Imxrt1052HwSdioInit }, #endif +#ifdef BSP_USING_USB +#ifdef BSP_USING_NXP_USBH + { "nxp hw usb", Imxrt1052HwUsbHostInit }, +#endif +#endif + #ifdef BSP_USING_I2C { "hw_i2c", Imxrt1052HwI2cInit }, #endif diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/usb/connect_usb.c b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/usb/connect_usb.c index 717659f9a..998b4c9e2 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/usb/connect_usb.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/usb/connect_usb.c @@ -28,7 +28,6 @@ Modification: #include #include -#define BSP_USING_NXP_USBH #ifdef BSP_USING_NXP_USBH /*! @brief USB host msd command instance global variable */ diff --git a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/board.c b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/board.c index 014925cd8..165a7025c 100644 --- a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/board.c +++ b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/board.c @@ -56,6 +56,10 @@ Modification: #include #endif +#ifdef BSP_USING_USB +#include +#endif + #ifdef BSP_USING_WDT #include #endif @@ -303,6 +307,12 @@ struct InitSequenceDesc _board_init[] = { "sdio", Imxrt1052HwSdioInit }, #endif +#ifdef BSP_USING_USB +#ifdef BSP_USING_NXP_USBH + { "nxp hw usb", Imxrt1052HwUsbHostInit }, +#endif +#endif + #ifdef BSP_USING_I2C { "hw_i2c", Imxrt1052HwI2cInit }, #endif diff --git a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/usb/connect_usb.c b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/usb/connect_usb.c index 536e52db3..c1db7d384 100644 --- a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/usb/connect_usb.c +++ b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/usb/connect_usb.c @@ -28,7 +28,6 @@ Modification: #include #include -#define BSP_USING_NXP_USBH #ifdef BSP_USING_NXP_USBH /*! @brief USB host msd command instance global variable */ diff --git a/Ubiquitous/XiZi_IIoT/kernel/thread/init.c b/Ubiquitous/XiZi_IIoT/kernel/thread/init.c index 7e7bf03d8..9d453c8f0 100644 --- a/Ubiquitous/XiZi_IIoT/kernel/thread/init.c +++ b/Ubiquitous/XiZi_IIoT/kernel/thread/init.c @@ -113,13 +113,6 @@ struct InitSequenceDesc components_init[] = }; struct InitSequenceDesc env_init[] = { -#ifdef BSP_USING_STM32_USBH - { "STM32USBHostRegister", STM32USBHostRegister }, - { "hw usb", Stm32HwUsbInit }, -#endif -#ifdef BSP_USING_NXP_USBH - { "nxp hw usb", Imxrt1052HwUsbHostInit }, -#endif #ifdef MOUNT_SDCARD { "MountSDCard", MountSDCard }, #endif