Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STM32F3] Use USART3_BASE instead of UART3_BASE #1810

Merged
merged 3 commits into from
May 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ typedef enum {

typedef enum {
UART_1 = (int)USART1_BASE,
UART_2 = (int)USART2_BASE
UART_2 = (int)USART2_BASE,
UART_3 = (int)USART3_BASE // defined for compilation issue. UART3 is not present on STM32F303K8
} UARTName;

#define STDIO_UART_TX PA_2
Expand Down
8 changes: 4 additions & 4 deletions hal/targets/hal/TARGET_STM/TARGET_STM32F3/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
__HAL_RCC_USART2_CONFIG(RCC_USART2CLKSOURCE_SYSCLK);
obj->index = 1;
}
#if defined(UART3_BASE)
#if defined(USART3_BASE)
if (obj->uart == UART_3) {
__USART3_CLK_ENABLE();
__HAL_RCC_USART3_CONFIG(RCC_USART3CLKSOURCE_SYSCLK);
Expand Down Expand Up @@ -157,7 +157,7 @@ void serial_free(serial_t *obj)
__USART2_RELEASE_RESET();
__USART2_CLK_DISABLE();
}
#if defined(UART3_BASE)
#if defined(USART3_BASE)
if (obj->uart == UART_3) {
__USART3_FORCE_RESET();
__USART3_RELEASE_RESET();
Expand Down Expand Up @@ -252,7 +252,7 @@ static void uart2_irq(void)
uart_irq(UART_2, 1);
}

#if defined(UART3_BASE)
#if defined(USART3_BASE)
static void uart3_irq(void)
{
uart_irq(UART_3, 2);
Expand Down Expand Up @@ -296,7 +296,7 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
vector = (uint32_t)&uart2_irq;
}

#if defined(UART3_BASE)
#if defined(USART3_BASE)
if (obj->uart == UART_3) {
irq_n = USART3_IRQn;
vector = (uint32_t)&uart3_irq;
Expand Down