move interrupt callbacks to peripherals

This commit is contained in:
Jan-Henrik 2020-04-13 16:46:11 +02:00
parent 07991c2cf4
commit 73bf23d79e
4 changed files with 14 additions and 13 deletions

View file

@ -3,3 +3,8 @@
IWDG_HandleTypeDef hiwdg = { .Instance = IWDG }; IWDG_HandleTypeDef hiwdg = { .Instance = IWDG };
TIM_HandleTypeDef htim2 = { .Instance = TIM2 }; TIM_HandleTypeDef htim2 = { .Instance = TIM2 };
SPI_HandleTypeDef hspi2 = { .Instance = SPI2 }; SPI_HandleTypeDef hspi2 = { .Instance = SPI2 };
void TIM2_IRQHandler()
{
HAL_TIM_IRQHandler(&htim2);
}

View file

@ -110,11 +110,6 @@ void SysTick_Handler(void)
system_clock.Tick(); system_clock.Tick();
} }
void TIM2_IRQHandler()
{
HAL_TIM_IRQHandler(&htim2);
}
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim) void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim)
{ {
if (htim != &htim2) { if (htim != &htim2) {

View file

@ -3,3 +3,12 @@
ADC_HandleTypeDef hadc1 = { .Instance = ADC1 }; ADC_HandleTypeDef hadc1 = { .Instance = ADC1 };
DMA_HandleTypeDef hdma1_channel1 = { .Instance = DMA1_Channel1 }; DMA_HandleTypeDef hdma1_channel1 = { .Instance = DMA1_Channel1 };
SPI_HandleTypeDef hspi1 = { .Instance = SPI1 }; SPI_HandleTypeDef hspi1 = { .Instance = SPI1 };
void DMA1_Channel1_IRQHandler(void)
{
HAL_DMA_IRQHandler(&hdma1_channel1);
}
void ADC1_IRQHandler(void)
{
HAL_ADC_IRQHandler(&hadc1);
}

View file

@ -80,14 +80,6 @@ void SystemClock_Config(void)
Error_Handler(); Error_Handler();
} }
} }
void DMA1_Channel1_IRQHandler(void)
{
HAL_DMA_IRQHandler(&hdma1_channel1);
}
void ADC1_IRQHandler(void)
{
HAL_ADC_IRQHandler(&hadc1);
}
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
{ {