Skip to content

Commit c2103a5

Browse files
committed
Revert "修复MCXN947开发板arduino接口中的串口无法使用以及串口再配置后无法收到数据的问题."
This reverts commit 1bcd5c8.
1 parent 1bcd5c8 commit c2103a5

File tree

3 files changed

+2
-60
lines changed

3 files changed

+2
-60
lines changed

bsp/nxp/mcx/mcxn/Libraries/drivers/drv_uart.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ static rt_err_t mcx_configure(struct rt_serial_device *serial, struct serial_con
133133
{
134134
struct mcx_uart *uart; /* Serial port hardware structure, calling the structure initialized above */
135135
lpuart_config_t config;/* It contains basic configuration parameters of the serial port, such as baud rate, data bit, stop bit, and parity check */
136-
rt_uint32_t irq_regval;
137136

138137
RT_ASSERT(serial != RT_NULL); /* assert */
139138
RT_ASSERT(cfg != RT_NULL);
@@ -160,14 +159,8 @@ static rt_err_t mcx_configure(struct rt_serial_device *serial, struct serial_con
160159

161160
config.enableTx = true;
162161
config.enableRx = true;
163-
164-
irq_regval = LPUART_GetEnabledInterrupts(uart->uart_base);
162+
165163
LPUART_Init(uart->uart_base, &config, CLOCK_GetFreq(uart->clock_src));
166-
if(irq_regval & kLPUART_RxDataRegFullInterruptEnable)
167-
{
168-
LPUART_EnableInterrupts(uart->uart_base, kLPUART_RxDataRegFullInterruptEnable);
169-
EnableIRQ(uart->irqn);
170-
}
171164

172165
return RT_EOK;
173166
}

bsp/nxp/mcx/mcxn/frdm-mcxn947/board/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if GetDepend(['PKG_USING_CJSON']) and GetDepend(['PKG_USING_WEBCLIENT']):
2424

2525

2626
CPPPATH = [cwd, cwd + '/MCUX_Config/board']
27-
CPPDEFINES = ['DEBUG', 'CPU_MCXN947VDF_cm33_core0', 'LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER=1']
27+
CPPDEFINES = ['DEBUG', 'CPU_MCXN947VDF_cm33_core0']
2828

2929
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES)
3030

bsp/nxp/mcx/mcxn/frdm-mcxn947/board/board.c

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -34,57 +34,6 @@ void SysTick_Handler(void)
3434
rt_interrupt_leave();
3535
}
3636

37-
/**
38-
* This function will initial the FlexComm mode.
39-
* +--------+----------------+--------+--------+--------------+
40-
* | Signal | LPSPI | LPUART | LPI2C | LPUART+LPI2C |
41-
* +--------+----------------+--------+--------+--------------+
42-
* | FC_P0 | SDO/DATA[0] | RXD | SDA | SDA |
43-
* | FC_P1 | SCK | TXD | SCL | SCL |
44-
* | FC_P2 | SDI/DATA[1] | RTS_b | SCLS | TXD |
45-
* | FC_P3 | PCS[0] | CTS_b | SDAS | RXD |
46-
* | FC_P4 | PCS[3]/DATA[3] | DSR_b | HREQ_b | CTS_b |
47-
* | FC_P5 | PCS[2]/DATA[2] | DTR_b | — | RTS_b |
48-
* | FC_P6 | PCS[1]/HREQ | DCD_b | — | HREQ_b |
49-
* +--------+----------------+--------+--------+--------------+
50-
*/
51-
void rt_hw_flexcomm_mode_init(void)
52-
{
53-
#ifdef BSP_USING_UART2
54-
LP_FLEXCOMM_Init(2, LP_FLEXCOMM_PERIPH_LPI2CAndLPUART); /* FLEXCOMM2 used for LPI2C and LPUART */
55-
#endif
56-
#ifdef BSP_USING_UART4
57-
LP_FLEXCOMM_Init(4, LP_FLEXCOMM_PERIPH_LPUART); /* FLEXCOMM4 used for LPUART */
58-
#endif
59-
#ifdef BSP_USING_UART5
60-
LP_FLEXCOMM_Init(5, LP_FLEXCOMM_PERIPH_LPUART); /* FLEXCOMM5 used for LPUART */
61-
#endif
62-
#ifdef BSP_USING_UART6
63-
LP_FLEXCOMM_Init(6, LP_FLEXCOMM_PERIPH_LPUART); /* FLEXCOMM6 used for LPUART */
64-
#endif
65-
#ifdef BSP_USING_SPI1
66-
LP_FLEXCOMM_Init(2, LP_FLEXCOMM_PERIPH_LPSPI); /* FLEXCOMM2 used for LPI2C and LPUART */
67-
#endif
68-
#ifdef BSP_USING_SPI3
69-
LP_FLEXCOMM_Init(3, LP_FLEXCOMM_PERIPH_LPSPI); /* FLEXCOMM3 used for LPSPI */
70-
#endif
71-
#ifdef BSP_USING_SPI6
72-
LP_FLEXCOMM_Init(6, LP_FLEXCOMM_PERIPH_LPSPI); /* FLEXCOMM6 used for LPSPI */
73-
#endif
74-
#ifdef BSP_USING_SPI7
75-
LP_FLEXCOMM_Init(7, LP_FLEXCOMM_PERIPH_LPSPI); /* FLEXCOMM7 used for LPSPI */
76-
#endif
77-
#ifdef BSP_USING_I2C0
78-
LP_FLEXCOMM_Init(0, LP_FLEXCOMM_PERIPH_LPI2C); /* FLEXCOMM0 used for LPI2C */
79-
#endif
80-
#ifdef BSP_USING_I2C1
81-
LP_FLEXCOMM_Init(1, LP_FLEXCOMM_PERIPH_LPI2C); /* FLEXCOMM1 used for LPI2C */
82-
#endif
83-
#ifdef BSP_USING_I2C2
84-
LP_FLEXCOMM_Init(2, LP_FLEXCOMM_PERIPH_LPI2C); /* FLEXCOMM2 used for LPI2C */
85-
#endif
86-
}
87-
8837
/**
8938
* This function will initial board.
9039
*/

0 commit comments

Comments
 (0)