mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-13 19:19:18 +00:00
fix build with imxrt
This commit is contained in:
parent
af0db342df
commit
810057bdb2
@ -79,7 +79,18 @@ void board_init(void)
|
||||
uart_config.baudRate_Bps = CFG_BOARD_UART_BAUDRATE;
|
||||
uart_config.enableTx = true;
|
||||
uart_config.enableRx = true;
|
||||
LPUART_Init(UART_PORT, &uart_config, (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U));
|
||||
|
||||
uint32_t freq;
|
||||
if (CLOCK_GetMux(kCLOCK_UartMux) == 0) /* PLL3 div6 80M */
|
||||
{
|
||||
freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
|
||||
}
|
||||
else
|
||||
{
|
||||
freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
|
||||
}
|
||||
|
||||
LPUART_Init(UART_PORT, &uart_config, freq);
|
||||
|
||||
//------------- USB0 -------------//
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
UF2_FAMILY_ID = 0x4fb2d5bd
|
||||
DEPS_SUBMODULES += hw/mcu/nxp/mcux-sdk
|
||||
SDK_DIR = hw/mcu/nxp/mcux-sdk
|
||||
DEPS_SUBMODULES += $(SDK_DIR)
|
||||
|
||||
include $(TOP)/$(BOARD_PATH)/board.mk
|
||||
|
||||
@ -17,7 +18,7 @@ CFLAGS += \
|
||||
# mcu driver cause following warnings
|
||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=implicit-fallthrough=
|
||||
|
||||
MCU_DIR = hw/mcu/nxp/mcux-sdk/devices/$(MCU_VARIANT)
|
||||
MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
|
||||
|
||||
# All source paths should be relative to the top level.
|
||||
LD_FILE = $(MCU_DIR)/gcc/$(MCU_VARIANT)xxxxx_flexspi_nor.ld
|
||||
@ -32,16 +33,19 @@ SRC_C += \
|
||||
$(MCU_DIR)/xip/fsl_flexspi_nor_boot.c \
|
||||
$(MCU_DIR)/project_template/clock_config.c \
|
||||
$(MCU_DIR)/drivers/fsl_clock.c \
|
||||
$(MCU_DIR)/drivers/fsl_gpio.c \
|
||||
$(MCU_DIR)/drivers/fsl_common.c \
|
||||
$(MCU_DIR)/drivers/fsl_lpuart.c
|
||||
$(SDK_DIR)/drivers/common/fsl_common.c \
|
||||
$(SDK_DIR)/drivers/igpio/fsl_gpio.c \
|
||||
$(SDK_DIR)/drivers/lpuart/fsl_lpuart.c
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(BOARD_PATH) \
|
||||
$(TOP)/$(MCU_DIR)/../../CMSIS/Include \
|
||||
$(TOP)/$(MCU_DIR) \
|
||||
$(TOP)/$(MCU_DIR)/drivers \
|
||||
$(TOP)/$(MCU_DIR)/project_template \
|
||||
$(TOP)/$(MCU_DIR)/drivers \
|
||||
$(TOP)/$(SDK_DIR)/drivers/common \
|
||||
$(TOP)/$(SDK_DIR)/drivers/igpio \
|
||||
$(TOP)/$(SDK_DIR)/drivers/lpuart
|
||||
|
||||
SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_VARIANT).S
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user