diff --git a/src/interrupts.c b/src/interrupts.c --- a/src/interrupts.c +++ b/src/interrupts.c @@ -5,11 +5,9 @@ #include "stm32f0xx_hal.h" #include "stm32f0xx.h" #include "interrupts.h" +#include "usart.h" #include "gpio.h" -extern DMA_HandleTypeDef hdma_usart1_rx; -extern DMA_HandleTypeDef hdma_usart1_tx; -extern UART_HandleTypeDef huart1; extern TIM_HandleTypeDef htim1; extern volatile uint8_t proceed; @@ -21,13 +19,13 @@ void SysTick_Handler(void) void DMA1_Channel2_3_IRQHandler(void) { - HAL_DMA_IRQHandler(&hdma_usart1_tx); - HAL_DMA_IRQHandler(&hdma_usart1_rx); + HAL_DMA_IRQHandler(uart_get_txdma_handle()); + HAL_DMA_IRQHandler(uart_get_txdma_handle()); } void USART1_IRQHandler(void) { - HAL_UART_IRQHandler(&huart1); + HAL_UART_IRQHandler(uart_gethandle()); } void TIM1_BRK_UP_TRG_COM_IRQHandler(void)