Skip to content

Commit 4079b3e

Browse files
committed
mimxrt/fsl_lpuart: Use a wrapper function to handle IRQ Idle support.
Signed-off-by: Andrew Leech <[email protected]>
1 parent 15d1a07 commit 4079b3e

File tree

3 files changed

+79
-2015
lines changed

3 files changed

+79
-2015
lines changed

ports/mimxrt/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ SRC_HAL_IMX_C += \
136136
$(MCUX_SDK_DIR)/drivers/lpi2c/fsl_lpi2c.c \
137137
$(MCUX_SDK_DIR)/drivers/lpspi/fsl_lpspi.c \
138138
$(MCUX_SDK_DIR)/drivers/lpspi/fsl_lpspi_edma.c \
139+
$(MCUX_SDK_DIR)/drivers/lpuart/fsl_lpuart.c \
139140
$(MCUX_SDK_DIR)/drivers/pit/fsl_pit.c \
140141
$(MCUX_SDK_DIR)/drivers/pwm/fsl_pwm.c \
141142
$(MCUX_SDK_DIR)/drivers/sai/fsl_sai.c \
@@ -151,6 +152,10 @@ else
151152
SRC_HAL_IMX_C += $(MCU_DIR)/xip/fsl_flexspi_nor_boot.c
152153
endif
153154

155+
# UART IRQ wrapper for UART.IRQ_RXIDLE support (see machine_uart.c for implementation details)
156+
# Double wrapping is required because SDK stores function pointers in s_lpuartIsr[] dispatch table
157+
LDFLAGS += --wrap=LPUART_TransferCreateHandle --wrap=LPUART_TransferHandleIRQ
158+
154159
INC_HAL_IMX += \
155160
-I$(TOP)/$(MCU_DIR) \
156161
-I$(TOP)/$(MCU_DIR)/drivers \
@@ -243,7 +248,6 @@ SRC_C += \
243248
eth.c \
244249
fatfs_port.c \
245250
flash.c \
246-
hal/fsl_lpuart.c \
247251
hal/pwm_backport.c \
248252
help.c \
249253
led.c \
@@ -489,7 +493,8 @@ LDFLAGS += \
489493
--cref \
490494
--gc-sections \
491495
--print-memory-usage \
492-
-Map=$@.map
496+
-Map=$@.map \
497+
--wrap=LPUART_TransferCreateHandle --wrap=LPUART_TransferHandleIRQ
493498

494499
# LDDEFINES are used for link time adaptation of linker scripts, utilizing
495500
# the C preprocessor. Therefore keep LDDEFINES separated from LDFLAGS!

0 commit comments

Comments
 (0)