Skip to content

Commit

Permalink
fix: receive on sync uart
Browse files Browse the repository at this point in the history
  • Loading branch information
andjordan committed Nov 15, 2024
1 parent db9ef3c commit c541d55
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions hal_st/synchronous_stm32fxxx/SynchronousUartStm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,15 @@ namespace hal
uartHandle.Init.Parity = USART_PARITY_NONE;
uartHandle.Init.Mode = USART_MODE_TX_RX;
uartHandle.Init.HwFlowCtl = flowControl;
#if defined(STM32F0) || defined(STM32F3) || defined(STM32F7) || defined(STM32WB)
uartHandle.Init.OverSampling = USART_OVERSAMPLING_8;
#if defined(UART_ONE_BIT_SAMPLE_ENABLE)
uartHandle.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_ENABLE;
#else
uartHandle.Init.OverSampling = UART_OVERSAMPLING_8;
#endif
uartHandle.Init.OverSampling = UART_OVERSAMPLING_8;

HAL_UART_Init(&uartHandle);

peripheralUart[uartIndex]->CR2 &= ~USART_CLOCK_ENABLED;

#if defined(STM32F0) || defined(STM32F1) || defined(STM32F3) || defined(STM32F7) || defined(STM32WB) || defined(STM32G4) || defined(STM32G0)
peripheralUart[uartIndex]->CR1 |= 1 << (USART_IT_RXNE & USART_IT_MASK);
#else
peripheralUart[uartIndex]->CR1 |= USART_IT_RXNE & USART_IT_MASK;
#endif
peripheralUart[uartIndex]->CR1 |= USART_CR1_RXNEIE;
}

SynchronousUartStm::~SynchronousUartStm()
Expand Down

0 comments on commit c541d55

Please sign in to comment.