stm32_serDes_protobuf_project/bsp/stm32f4xx_it.c

48 lines
806 B
C
Raw Normal View History

2024-05-13 15:21:22 +03:00
#include "stm32f4xx_it.h"
#include "lwip/ethernetif.h"
static volatile uint32_t sys_tick = 0;
void SysTick_Handler(void)
{
sys_tick++;
}
uint32_t getSysTick() {
return sys_tick;
}
#define MAX_DELAY 0xFFFFFFFFU
void delay(uint32_t delay) {
uint32_t tickStart = getSysTick();
uint32_t wait = delay;
if (wait < MAX_DELAY) {
wait++;
}
while((getSysTick() - tickStart) < wait) {}
}
2024-05-15 02:15:03 +03:00
void TIM7_IRQHandler()
{
TIM_ClearITPendingBit(TIM7, TIM_IT_Update);
if(getLwipStatus()->link_status == LINK_UP) {
GPIO_ToggleBits(GPIOB, GPIO_Pin_7);
}
else {
GPIO_ResetBits(GPIOB, GPIO_Pin_7);
}
}
2024-05-13 15:21:22 +03:00
void USART2_IRQHandler(void)
{
}
void ETH_IRQHandler(void)
{
HAL_ETH_IRQHandler(getEthStruct());
}