mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Small USART scalability fix.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@616 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
8f3c2dbafb
commit
fe9aa9e38f
@ -94,6 +94,7 @@ SRC += $(PIOSSTM32F10X)/pios_delay.c
|
||||
SRC += $(PIOSSTM32F10X)/pios_usart.c
|
||||
SRC += $(PIOSSTM32F10X)/pios_irq.c
|
||||
SRC += $(PIOSSTM32F10X)/pios_adc.c
|
||||
#SRC += $(PIOSSTM32F10X)/pios_i2c.c
|
||||
#SRC += $(PIOSSTM32F10X)/pios_spi.c
|
||||
|
||||
## PIOS Hardware (Common)
|
||||
|
@ -193,12 +193,17 @@ void PIOS_USART_ChangeBaud(USARTNumTypeDef usart, uint32_t baud)
|
||||
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
|
||||
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
|
||||
USART_InitStructure.USART_BaudRate = baud;
|
||||
if (usart == USART_1)
|
||||
if (usart == USART_1) {
|
||||
USART_Init(PIOS_USART1_USART, &USART_InitStructure);
|
||||
else if (usart == USART_2)
|
||||
} else if (usart == USART_2) {
|
||||
#if (PIOS_USART2_ENABLED)
|
||||
USART_Init(PIOS_USART2_USART, &USART_InitStructure);
|
||||
else if (usart == USART_3)
|
||||
#endif
|
||||
} else if (usart == USART_3) {
|
||||
#if (PIOS_USART3_ENABLED)
|
||||
USART_Init(PIOS_USART3_USART, &USART_InitStructure);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user