STM32H750VB_EPD/Core/Src/user_irq_handlers.c

21 lines
608 B
C

#include "cmsis_os2.h"
#include "main.h"
#include "user_epd_impl.h"
extern uint8_t g_epd_busy_irq_flag;
extern osSemaphoreId_t g_epd_busy_semphr;
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
// FIXME
if(GPIO_Pin == SPI2_BUSY_Pin) {
if(osKernelGetState() != osKernelRunning) { // Kernel has not started, write poll variable
g_epd_busy_irq_flag = 1;
}
else { // Kernel has started, release semaphore.
osSemaphoreRelease(g_epd_busy_semphr);
// CMSIS-OS2 wraps FreeRTOS call, no need to use __xxFromISR functions here.
}
}
}