mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
Remove reference to USART_TypeDef in io, refactor uartOpen and serialUART
This commit is contained in:
parent
c31fb92ad5
commit
0cf5161ec4
10 changed files with 85 additions and 186 deletions
|
@ -286,3 +286,25 @@ void USART3_IRQHandler(void)
|
|||
uartIrqCallback(s);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Temporary solution until serialUARTx() are refactored/consolidated
|
||||
|
||||
uartPort_t *serialUART(UARTDevice device, uint32_t baudRate, portMode_t mode, portOptions_t options)
|
||||
{
|
||||
switch (device) {
|
||||
#ifdef USE_UART1
|
||||
case UARTDEV_1:
|
||||
return serialUART1(baudRate, mode, options);
|
||||
#endif
|
||||
#ifdef USE_UART2
|
||||
case UARTDEV_2:
|
||||
return serialUART2(baudRate, mode, options);
|
||||
#endif
|
||||
#ifdef USE_UART3
|
||||
case UARTDEV_3:
|
||||
return serialUART3(baudRate, mode, options);
|
||||
#endif
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue