Syrostan-MCU-C/Core/Src/User/user_isr.c

29 lines
460 B
C

#include "user_isr.h"
void timer4_isr()
{
static uint16_t cnt = 0;
if (cnt > 999)
{
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
cnt = 0;
}
else
{
cnt++;
}
}
void adc1_dma_isr()
{
power_adc_calculate();
}
GPIO_PinState fault_state;
void exti2_isr()
{
fault_state = HAL_GPIO_ReadPin(EEM_POWER_FAULT_GPIO_Port, EEM_POWER_FAULT_Pin);
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, fault_state);
}