mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
usart: fix lower usarts clobbering higher ones
The break statements are clearly missing from this switch statement. This would lead to problems when using more than one USART on CC.
This commit is contained in:
parent
b2b4bcc474
commit
a7cce25252
@ -180,9 +180,15 @@ int32_t PIOS_USART_Init(uint32_t * usart_id, const struct pios_usart_cfg * cfg)
|
||||
|
||||
/* Configure USART Interrupts */
|
||||
switch ((uint32_t)usart_dev->cfg->regs) {
|
||||
case (uint32_t)USART1: PIOS_USART_1_id = (uint32_t)usart_dev;
|
||||
case (uint32_t)USART2: PIOS_USART_2_id = (uint32_t)usart_dev;
|
||||
case (uint32_t)USART3: PIOS_USART_3_id = (uint32_t)usart_dev;
|
||||
case (uint32_t)USART1:
|
||||
PIOS_USART_1_id = (uint32_t)usart_dev;
|
||||
break;
|
||||
case (uint32_t)USART2:
|
||||
PIOS_USART_2_id = (uint32_t)usart_dev;
|
||||
break;
|
||||
case (uint32_t)USART3:
|
||||
PIOS_USART_3_id = (uint32_t)usart_dev;
|
||||
break;
|
||||
}
|
||||
NVIC_Init(&usart_dev->cfg->irq.init);
|
||||
USART_ITConfig(usart_dev->cfg->regs, USART_IT_RXNE, ENABLE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user