feat: non inverted SBUS trainer support on serial inputs on H5/H7 (#7133)
This commit is contained in:
@@ -281,6 +281,11 @@ static void* stm32_serial_init(void* hw_def, const etx_serial_init* params)
|
||||
if (sp->tx_buffer.length > 0) {
|
||||
st->callbacks.on_send = _on_send_fifo;
|
||||
}
|
||||
#if defined(STM32H7) || defined(STM32H7RS) || defined(STM32H5)
|
||||
if (params->polarity & ETX_Pol_Inverted)
|
||||
stm32_usart_tx_inversion(usart, true);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if (params->direction & ETX_Dir_RX) {
|
||||
@@ -288,6 +293,11 @@ static void* stm32_serial_init(void* hw_def, const etx_serial_init* params)
|
||||
auto rx_buf = sp->rx_buffer.buffer;
|
||||
auto buf_len = sp->rx_buffer.length;
|
||||
|
||||
#if defined(STM32H7) || defined(STM32H7RS) || defined(STM32H5)
|
||||
if (params->polarity & ETX_Pol_Inverted)
|
||||
stm32_usart_rx_inversion(usart, true);
|
||||
#endif
|
||||
|
||||
if (usart->rxDMA) {
|
||||
stm32_usart_init_rx_dma(usart, rx_buf, buf_len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user