rename board specific macro for example

- BOARD_DEVICE/HOST_RHPORT_NUM to  BOARD_TUD/H_RHPORT
- BOARD_DEVICE/HOST_RHPORT_SPEED to  BOARD_TUD/H_MAX_SPEED
This commit is contained in:
hathach
2022-06-01 23:53:40 +07:00
parent d1d6bd2831
commit 99c1585ed2
29 changed files with 226 additions and 210 deletions

View File

@@ -122,7 +122,7 @@ void board_init(void)
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
HAL_UART_Init(&UartHandle);
#if BOARD_DEVICE_RHPORT_NUM == 0
#if BOARD_TUD_RHPORT == 0
// Despite being call USB2_OTG
// OTG_FS is marked as RHPort0 by TinyUSB to be consistent across stm32 port
// PA9 VUSB, PA10 ID, PA11 DM, PA12 DP
@@ -166,7 +166,7 @@ void board_init(void)
USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
#endif // vbus sense
#elif BOARD_DEVICE_RHPORT_NUM == 1
#elif BOARD_TUD_RHPORT == 1
// Despite being call USB2_OTG
// OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port

View File

@@ -16,14 +16,14 @@ CFLAGS += \
-mfpu=fpv5-d16 \
-nostdlib -nostartfiles \
-DCFG_TUSB_MCU=OPT_MCU_STM32H7 \
-DBOARD_DEVICE_RHPORT_NUM=$(PORT)
-DBOARD_TUD_RHPORT=$(PORT)
ifeq ($(PORT), 1)
ifeq ($(SPEED), high)
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
CFLAGS += -DBOARD_TUD_MAX_SPEED=OPT_MODE_HIGH_SPEED
$(info "Using OTG_HS in HighSpeed mode")
else
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_FULL_SPEED
CFLAGS += -DBOARD_TUD_MAX_SPEED=OPT_MODE_FULL_SPEED
$(info "Using OTG_HS in FullSpeed mode")
endif
else