1
0
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:
gussy 2010-05-12 01:56:00 +00:00 committed by gussy
parent 8f3c2dbafb
commit fe9aa9e38f
2 changed files with 9 additions and 3 deletions

View File

@ -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)

View File

@ -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
}
}
/**