mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-14 04:18:56 +00:00
fix f7 ci build
This commit is contained in:
parent
92e7ac6c23
commit
9897a36ac4
@ -122,7 +122,7 @@ static board_pindef_t vbus_pindef[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static inline void board_vbus_set(uint8_t rhport, bool state) {
|
||||
void board_vbus_set(uint8_t rhport, bool state) {
|
||||
static bool pin_inited[2] = { false, false };
|
||||
board_pindef_t* pindef = &vbus_pindef[rhport];
|
||||
if (!pin_inited[rhport]) {
|
||||
|
@ -28,6 +28,9 @@
|
||||
|
||||
#include "stm32f7xx_hal.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
void board_vbus_set(uint8_t rhport, bool state) TU_ATTR_WEAK;
|
||||
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -60,14 +60,6 @@
|
||||
{GPIOB, GPIO_PIN_5 }, {GPIOB, GPIO_PIN_10}, {GPIOB, GPIO_PIN_11}, {GPIOB, GPIO_PIN_12}, \
|
||||
{GPIOB, GPIO_PIN_13}, {GPIOC, GPIO_PIN_0 }, {GPIOH, GPIO_PIN_4 }, {GPIOI, GPIO_PIN_11}
|
||||
|
||||
// vbus drive
|
||||
#define BOARD_VBUS_DRIVE(_rhport, _on) do { \
|
||||
if ( mfx_io_drv ) { \
|
||||
uint32_t io_pin = (_rhport) ? MFXSTM32L152_GPIO_PIN_9 : MFXSTM32L152_GPIO_PIN_7; \
|
||||
mfx_io_drv->IO_WritePin(&Io_CompObj, io_pin, _on); \
|
||||
}\
|
||||
} while(0)
|
||||
|
||||
/* Definition for I2C1 Pins */
|
||||
#define BUS_I2C1_SCL_PIN GPIO_PIN_6
|
||||
#define BUS_I2C1_SDA_PIN GPIO_PIN_7
|
||||
@ -283,6 +275,13 @@ static inline void board_init2(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
// vbus drive
|
||||
void board_vbus_set(uint8_t rhport, bool state) {
|
||||
if ( mfx_io_drv ) {
|
||||
uint32_t io_pin = (_rhport) ? MFXSTM32L152_GPIO_PIN_9 : MFXSTM32L152_GPIO_PIN_7;
|
||||
mfx_io_drv->IO_WritePin(&Io_CompObj, io_pin, _on);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -30,8 +30,8 @@
|
||||
#include "stm32h7xx_hal.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
TU_ATTR_UNUSED static void Error_Handler(void) {
|
||||
}
|
||||
TU_ATTR_UNUSED static void Error_Handler(void) { }
|
||||
void board_vbus_set(uint8_t rhport, bool state) TU_ATTR_WEAK;
|
||||
|
||||
#include "board.h"
|
||||
|
||||
@ -196,6 +196,7 @@ void board_init(void) {
|
||||
#endif // vbus sense
|
||||
|
||||
//------------- USB HS -------------//
|
||||
#if (CFG_TUD_ENABLED && BOARD_TUD_RHPORT == 1) || (CFG_TUH_ENABLED && BOARD_TUH_RHPORT == 1)
|
||||
// Despite being call USB2_OTG
|
||||
// OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port
|
||||
struct {
|
||||
@ -232,14 +233,15 @@ void board_init(void) {
|
||||
// Force device mode
|
||||
USB_OTG_HS->GUSBCFG &= ~USB_OTG_GUSBCFG_FHMOD;
|
||||
USB_OTG_HS->GUSBCFG |= USB_OTG_GUSBCFG_FDMOD;
|
||||
#endif
|
||||
|
||||
HAL_PWREx_EnableUSBVoltageDetector();
|
||||
|
||||
// For waveshare openh743 ULPI PHY reset walkaround
|
||||
board_init2();
|
||||
|
||||
#if CFG_TUH_ENABLED && defined(BOARD_VBUS_DRIVE)
|
||||
BOARD_VBUS_DRIVE(BOARD_TUH_RHPORT, 1);
|
||||
#if CFG_TUH_ENABLED
|
||||
board_vbus_set(BOARD_TUH_RHPORT, 1);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user