mirror of https://github.com/ARMmbed/mbed-os.git
[B96B_F446VE] bug fix for serial_async unitary test
do not initialise dma tx/rx when it is not activated.pull/1493/head
parent
44cb38ba7c
commit
016976b79d
|
@ -89,6 +89,7 @@ static void init_uart(serial_t *obj)
|
|||
UartHandle.Init.Mode = UART_MODE_TX_RX;
|
||||
}
|
||||
#if DEVICE_SERIAL_ASYNCH_DMA
|
||||
if (SERIAL_OBJ(pin_tx) != NC) {
|
||||
// set DMA in the UartHandle
|
||||
/* Configure the DMA handler for Transmission process */
|
||||
hdma_tx.Instance = (DMA_Stream_TypeDef *)DMA_UartTx_Stream[SERIAL_OBJ(index)];
|
||||
|
@ -109,7 +110,9 @@ static void init_uart(serial_t *obj)
|
|||
|
||||
/* Associate the initialized DMA handle to the UART handle */
|
||||
__HAL_LINKDMA(&UartHandle, hdmatx, hdma_tx);
|
||||
}
|
||||
|
||||
if (SERIAL_OBJ(pin_rx) != NC) {
|
||||
/* Configure the DMA handler for reception process */
|
||||
hdma_rx.Instance = (DMA_Stream_TypeDef *)DMA_UartRx_Stream[SERIAL_OBJ(index)];
|
||||
hdma_rx.Init.Channel = DMA_UartRx_Channel[SERIAL_OBJ(index)];
|
||||
|
@ -129,6 +132,7 @@ static void init_uart(serial_t *obj)
|
|||
|
||||
/* Associate the initialized DMA handle to the UART handle */
|
||||
__HAL_LINKDMA(&UartHandle, hdmarx, hdma_rx);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (HAL_UART_Init(&UartHandle) != HAL_OK) {
|
||||
|
|
Loading…
Reference in New Issue