Files
Last update 2 years 1 month
by
PzCampus
Filessoftwarecoresrc | |
---|---|
.. | |
dcc | |
gpio.c | |
main.c | |
stm32l0xx_hal_msp.c | |
stm32l0xx_it.c | |
system_stm32l0xx.c | |
tim.c |
stm32l0xx_it.c/** ****************************************************************************** * @file stm32l0xx_it.c * @brief Interrupt Service Routines. ****************************************************************************** * @attention * * Copyright (c) 2022 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ #include "main.h" #include "stm32l0xx_it.h" #include "decoder.h" extern TIM_HandleTypeDef htim2; /******************************************************************************/ /* Cortex-M0+ Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable Interrupt. */ void NMI_Handler(void) { while (1) { } } /** * @brief This function handles Hard fault interrupt. */ void HardFault_Handler(void) { while (1) { } } /** * @brief This function handles System service call via SWI instruction. */ void SVC_Handler(void) { } /** * @brief This function handles Pendable request for system service. */ void PendSV_Handler(void) { } /** * @brief This function handles System tick timer. */ void SysTick_Handler(void) { HAL_IncTick(); } /******************************************************************************/ /* STM32L0xx Peripheral Interrupt Handlers */ /* Add here the Interrupt Handlers for the used peripherals. */ /* For the available peripheral interrupt handler names, */ /* please refer to the startup file (startup_stm32l0xx.s). */ /******************************************************************************/ /** * @brief This function handles EXTI line 4 to 15 interrupts. */ void EXTI4_15_IRQHandler(void) { if (DCC_DATA_GPIO_Port->IDR & DCC_DATA_Pin){ uint16_t val = htim2.Instance->CNT; htim2.Instance->CNT = 0; interrupt_funct(val); } HAL_GPIO_EXTI_IRQHandler(DCC_DATA_Pin); } /** * @brief This function handles TIM2 global interrupt. */ void TIM2_IRQHandler(void) { HAL_TIM_IRQHandler(&htim2); /* Overflow: reset the receiver */ interrupt_funct(65535); }