Rev 2 | Rev 7 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 2 | mjames | 1 | /** |
| 2 | ****************************************************************************** |
||
| 3 | * @file stm32l1xx_it.c |
||
| 4 | * @brief Interrupt Service Routines. |
||
| 5 | ****************************************************************************** |
||
| 6 | * |
||
| 7 | * COPYRIGHT(c) 2016 STMicroelectronics |
||
| 8 | * |
||
| 9 | * Redistribution and use in source and binary forms, with or without modification, |
||
| 10 | * are permitted provided that the following conditions are met: |
||
| 11 | * 1. Redistributions of source code must retain the above copyright notice, |
||
| 12 | * this list of conditions and the following disclaimer. |
||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
||
| 14 | * this list of conditions and the following disclaimer in the documentation |
||
| 15 | * and/or other materials provided with the distribution. |
||
| 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
||
| 17 | * may be used to endorse or promote products derived from this software |
||
| 18 | * without specific prior written permission. |
||
| 19 | * |
||
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
||
| 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||
| 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
||
| 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
||
| 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
||
| 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
||
| 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
||
| 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
||
| 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||
| 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||
| 30 | * |
||
| 31 | ****************************************************************************** |
||
| 32 | */ |
||
| 33 | /* Includes ------------------------------------------------------------------*/ |
||
| 34 | #include "stm32l1xx_hal.h" |
||
| 35 | #include "stm32l1xx.h" |
||
| 36 | #include "stm32l1xx_it.h" |
||
| 37 | |||
| 38 | /* USER CODE BEGIN 0 */ |
||
| 39 | |||
| 40 | /* USER CODE END 0 */ |
||
| 41 | |||
| 42 | /* External variables --------------------------------------------------------*/ |
||
| 6 | mjames | 43 | extern DMA_HandleTypeDef hdma_adc; |
| 44 | extern TIM_HandleTypeDef htim2; |
||
| 45 | extern UART_HandleTypeDef huart1; |
||
| 46 | extern UART_HandleTypeDef huart2; |
||
| 2 | mjames | 47 | |
| 48 | /******************************************************************************/ |
||
| 49 | /* Cortex-M3 Processor Interruption and Exception Handlers */ |
||
| 50 | /******************************************************************************/ |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @brief This function handles Non maskable interrupt. |
||
| 54 | */ |
||
| 55 | void NMI_Handler(void) |
||
| 56 | { |
||
| 57 | /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ |
||
| 58 | |||
| 59 | /* USER CODE END NonMaskableInt_IRQn 0 */ |
||
| 60 | /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ |
||
| 61 | |||
| 62 | /* USER CODE END NonMaskableInt_IRQn 1 */ |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @brief This function handles Hard fault interrupt. |
||
| 67 | */ |
||
| 68 | void HardFault_Handler(void) |
||
| 69 | { |
||
| 70 | /* USER CODE BEGIN HardFault_IRQn 0 */ |
||
| 71 | |||
| 72 | /* USER CODE END HardFault_IRQn 0 */ |
||
| 73 | while (1) |
||
| 74 | { |
||
| 75 | } |
||
| 76 | /* USER CODE BEGIN HardFault_IRQn 1 */ |
||
| 77 | |||
| 78 | /* USER CODE END HardFault_IRQn 1 */ |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @brief This function handles Memory management fault. |
||
| 83 | */ |
||
| 84 | void MemManage_Handler(void) |
||
| 85 | { |
||
| 86 | /* USER CODE BEGIN MemoryManagement_IRQn 0 */ |
||
| 87 | |||
| 88 | /* USER CODE END MemoryManagement_IRQn 0 */ |
||
| 89 | while (1) |
||
| 90 | { |
||
| 91 | } |
||
| 92 | /* USER CODE BEGIN MemoryManagement_IRQn 1 */ |
||
| 93 | |||
| 94 | /* USER CODE END MemoryManagement_IRQn 1 */ |
||
| 95 | } |
||
| 96 | |||
| 97 | /** |
||
| 98 | * @brief This function handles Pre-fetch fault, memory access fault. |
||
| 99 | */ |
||
| 100 | void BusFault_Handler(void) |
||
| 101 | { |
||
| 102 | /* USER CODE BEGIN BusFault_IRQn 0 */ |
||
| 103 | |||
| 104 | /* USER CODE END BusFault_IRQn 0 */ |
||
| 105 | while (1) |
||
| 106 | { |
||
| 107 | } |
||
| 108 | /* USER CODE BEGIN BusFault_IRQn 1 */ |
||
| 109 | |||
| 110 | /* USER CODE END BusFault_IRQn 1 */ |
||
| 111 | } |
||
| 112 | |||
| 113 | /** |
||
| 114 | * @brief This function handles Undefined instruction or illegal state. |
||
| 115 | */ |
||
| 116 | void UsageFault_Handler(void) |
||
| 117 | { |
||
| 118 | /* USER CODE BEGIN UsageFault_IRQn 0 */ |
||
| 119 | |||
| 120 | /* USER CODE END UsageFault_IRQn 0 */ |
||
| 121 | while (1) |
||
| 122 | { |
||
| 123 | } |
||
| 124 | /* USER CODE BEGIN UsageFault_IRQn 1 */ |
||
| 125 | |||
| 126 | /* USER CODE END UsageFault_IRQn 1 */ |
||
| 127 | } |
||
| 128 | |||
| 129 | /** |
||
| 130 | * @brief This function handles System service call via SWI instruction. |
||
| 131 | */ |
||
| 132 | void SVC_Handler(void) |
||
| 133 | { |
||
| 134 | /* USER CODE BEGIN SVC_IRQn 0 */ |
||
| 135 | |||
| 136 | /* USER CODE END SVC_IRQn 0 */ |
||
| 137 | /* USER CODE BEGIN SVC_IRQn 1 */ |
||
| 138 | |||
| 139 | /* USER CODE END SVC_IRQn 1 */ |
||
| 140 | } |
||
| 141 | |||
| 142 | /** |
||
| 143 | * @brief This function handles Debug monitor. |
||
| 144 | */ |
||
| 145 | void DebugMon_Handler(void) |
||
| 146 | { |
||
| 147 | /* USER CODE BEGIN DebugMonitor_IRQn 0 */ |
||
| 148 | |||
| 149 | /* USER CODE END DebugMonitor_IRQn 0 */ |
||
| 150 | /* USER CODE BEGIN DebugMonitor_IRQn 1 */ |
||
| 151 | |||
| 152 | /* USER CODE END DebugMonitor_IRQn 1 */ |
||
| 153 | } |
||
| 154 | |||
| 155 | /** |
||
| 156 | * @brief This function handles Pendable request for system service. |
||
| 157 | */ |
||
| 158 | void PendSV_Handler(void) |
||
| 159 | { |
||
| 160 | /* USER CODE BEGIN PendSV_IRQn 0 */ |
||
| 161 | |||
| 162 | /* USER CODE END PendSV_IRQn 0 */ |
||
| 163 | /* USER CODE BEGIN PendSV_IRQn 1 */ |
||
| 164 | |||
| 165 | /* USER CODE END PendSV_IRQn 1 */ |
||
| 166 | } |
||
| 167 | |||
| 168 | /** |
||
| 169 | * @brief This function handles System tick timer. |
||
| 170 | */ |
||
| 171 | void SysTick_Handler(void) |
||
| 172 | { |
||
| 173 | /* USER CODE BEGIN SysTick_IRQn 0 */ |
||
| 174 | |||
| 175 | /* USER CODE END SysTick_IRQn 0 */ |
||
| 176 | HAL_IncTick(); |
||
| 177 | HAL_SYSTICK_IRQHandler(); |
||
| 178 | /* USER CODE BEGIN SysTick_IRQn 1 */ |
||
| 179 | |||
| 180 | /* USER CODE END SysTick_IRQn 1 */ |
||
| 181 | } |
||
| 182 | |||
| 183 | /******************************************************************************/ |
||
| 184 | /* STM32L1xx Peripheral Interrupt Handlers */ |
||
| 185 | /* Add here the Interrupt Handlers for the used peripherals. */ |
||
| 186 | /* For the available peripheral interrupt handler names, */ |
||
| 187 | /* please refer to the startup file (startup_stm32l1xx.s). */ |
||
| 188 | /******************************************************************************/ |
||
| 189 | |||
| 6 | mjames | 190 | /** |
| 191 | * @brief This function handles DMA1 channel1 global interrupt. |
||
| 192 | */ |
||
| 193 | void DMA1_Channel1_IRQHandler(void) |
||
| 194 | { |
||
| 195 | /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */ |
||
| 196 | |||
| 197 | /* USER CODE END DMA1_Channel1_IRQn 0 */ |
||
| 198 | HAL_DMA_IRQHandler(&hdma_adc); |
||
| 199 | /* USER CODE BEGIN DMA1_Channel1_IRQn 1 */ |
||
| 200 | |||
| 201 | /* USER CODE END DMA1_Channel1_IRQn 1 */ |
||
| 202 | } |
||
| 203 | |||
| 204 | /** |
||
| 205 | * @brief This function handles TIM2 global interrupt. |
||
| 206 | */ |
||
| 207 | void TIM2_IRQHandler(void) |
||
| 208 | { |
||
| 209 | /* USER CODE BEGIN TIM2_IRQn 0 */ |
||
| 210 | |||
| 211 | /* USER CODE END TIM2_IRQn 0 */ |
||
| 212 | HAL_TIM_IRQHandler(&htim2); |
||
| 213 | /* USER CODE BEGIN TIM2_IRQn 1 */ |
||
| 214 | |||
| 215 | /* USER CODE END TIM2_IRQn 1 */ |
||
| 216 | } |
||
| 217 | |||
| 218 | /** |
||
| 219 | * @brief This function handles USART1 global interrupt. |
||
| 220 | */ |
||
| 221 | void USART1_IRQHandler(void) |
||
| 222 | { |
||
| 223 | /* USER CODE BEGIN USART1_IRQn 0 */ |
||
| 224 | |||
| 225 | /* USER CODE END USART1_IRQn 0 */ |
||
| 226 | HAL_UART_IRQHandler(&huart1); |
||
| 227 | /* USER CODE BEGIN USART1_IRQn 1 */ |
||
| 228 | |||
| 229 | /* USER CODE END USART1_IRQn 1 */ |
||
| 230 | } |
||
| 231 | |||
| 232 | /** |
||
| 233 | * @brief This function handles USART2 global interrupt. |
||
| 234 | */ |
||
| 235 | void USART2_IRQHandler(void) |
||
| 236 | { |
||
| 237 | /* USER CODE BEGIN USART2_IRQn 0 */ |
||
| 238 | |||
| 239 | /* USER CODE END USART2_IRQn 0 */ |
||
| 240 | HAL_UART_IRQHandler(&huart2); |
||
| 241 | /* USER CODE BEGIN USART2_IRQn 1 */ |
||
| 242 | |||
| 243 | /* USER CODE END USART2_IRQn 1 */ |
||
| 244 | } |
||
| 245 | |||
| 2 | mjames | 246 | /* USER CODE BEGIN 1 */ |
| 247 | |||
| 248 | /* USER CODE END 1 */ |
||
| 249 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |