summaryrefslogtreecommitdiff
path: root/app/platform/stm32f0-gcc/platform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'app/platform/stm32f0-gcc/platform.cpp')
-rw-r--r--app/platform/stm32f0-gcc/platform.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/platform/stm32f0-gcc/platform.cpp b/app/platform/stm32f0-gcc/platform.cpp
index 00bc391..c74a3c4 100644
--- a/app/platform/stm32f0-gcc/platform.cpp
+++ b/app/platform/stm32f0-gcc/platform.cpp
@@ -1,9 +1,11 @@
#include "platform/platform.h"
#include "retarget.h"
+#include "third_party/CMSIS/Device/Include/stm32f0xx.h"
#include "third_party/CMSIS/Device/Include/system_stm32f0xx.h"
#include "third_party/STM32F0xx_StdPeriph_Driver/inc/stm32f0xx_usart.h"
#include "third_party/STM32F0xx_StdPeriph_Driver/inc/stm32f0xx_rcc.h"
#include "third_party/STM32F0xx_StdPeriph_Driver/inc/stm32f0xx_gpio.h"
+#include "third_party/STM32F0xx_StdPeriph_Driver/inc/stm32f0xx_misc.h"
#if defined(__GNUC__)
#pragma GCC diagnostic push
@@ -36,6 +38,11 @@ static void USART1Init(void)
USART1->CR1 |= USART_CR1_RXNEIE;
USART1->CR3 |= USART_CR3_OVRDIS;
USART_Cmd(USART1, ENABLE);
+ NVIC_InitTypeDef NVIC_InitStructure;
+ NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;
+ NVIC_InitStructure.NVIC_IRQChannelPriority = 1;
+ NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
+ NVIC_Init(&NVIC_InitStructure);
// TODO get rid of SPL
}
@@ -65,6 +72,11 @@ static void USART4Init(void)
USART4->CR1 |= USART_CR1_RXNEIE;
USART4->CR3 |= USART_CR3_OVRDIS;
USART_Cmd(USART4, ENABLE);
+ NVIC_InitTypeDef NVIC_InitStructure;
+ NVIC_InitStructure.NVIC_IRQChannel = USART3_4_IRQn;
+ NVIC_InitStructure.NVIC_IRQChannelPriority = 1;
+ NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
+ NVIC_Init(&NVIC_InitStructure);
// TODO get rid of SPL
}
@@ -117,6 +129,11 @@ static void USART3Init(void)
USART3->CR1 |= USART_CR1_RXNEIE;
USART3->CR3 |= USART_CR3_OVRDIS;
USART_Cmd(USART3, ENABLE);
+ NVIC_InitTypeDef NVIC_InitStructure;
+ NVIC_InitStructure.NVIC_IRQChannel = USART3_4_IRQn;
+ NVIC_InitStructure.NVIC_IRQChannelPriority = 1;
+ NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
+ NVIC_Init(&NVIC_InitStructure);
// TODO get rid of SPL
}