Files
@ 48ae84f03494
Branch filter:
Location: protofuse-firmware/src/interrupts.c - annotation
48ae84f03494
1.1 KiB
text/plain
Update to new HAL library, add some ADC code
ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d 7e9d097bfe72 ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 7e9d097bfe72 | //
// Interrupts: handlers for any needed global interrupts
//
#include "stm32f3xx_hal.h"
#include "stm32f3xx.h"
#include "interrupts.h"
#include "gpio.h"
// Systick interrupt
void SysTick_Handler(void)
{
HAL_IncTick();
HAL_SYSTICK_IRQHandler();
}
void EXTI9_5_IRQHandler(void)
{
/* USER CODE BEGIN EXTI9_5_IRQn 0 */
/* USER CODE END EXTI9_5_IRQn 0 */
HAL_GPIO_EXTI_IRQHandler(SW_A_Pin);
HAL_GPIO_EXTI_IRQHandler(SW_BTN_Pin);
HAL_GPIO_EXTI_IRQHandler(SW_C_Pin);
/* USER CODE BEGIN EXTI9_5_IRQn 1 */
/* USER CODE END EXTI9_5_IRQn 1 */
}
void EXTI15_10_IRQHandler(void)
{
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
/* USER CODE END EXTI15_10_IRQn 0 */
HAL_GPIO_EXTI_IRQHandler(SW_D_Pin);
HAL_GPIO_EXTI_IRQHandler(SW_B_Pin);
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
/* USER CODE END EXTI15_10_IRQn 1 */
}
uint32_t last_button_press = 0;
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
switch(GPIO_Pin)
{
case SW_BTN_Pin:
{
if(HAL_GetTick() > last_button_press + 100)
{
HAL_GPIO_TogglePin(LED_RED);
last_button_press = HAL_GetTick();
}
} break;
}
}
|