25 lines
694 B
C
25 lines
694 B
C
#include "cmsis_os2.h"
|
|
|
|
#include "main.h"
|
|
|
|
#include "user_epd_impl.h"
|
|
|
|
extern osSemaphoreId_t g_epd_busy_semphr;
|
|
extern osSemaphoreId_t g_spi2_semphr;
|
|
|
|
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
|
|
if(GPIO_Pin == SPI2_BUSY_Pin) {
|
|
if(osKernelGetState() == osKernelRunning) { // Kernel has started, release semaphore.
|
|
osSemaphoreRelease(g_epd_busy_semphr);
|
|
// CMSIS-OS2 wraps FreeRTOS call, no need to use __xxFromISR functions here.
|
|
}
|
|
}
|
|
}
|
|
|
|
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi) {
|
|
if(hspi->Instance == SPI2) {
|
|
if(osKernelGetState() == osKernelRunning) {
|
|
osSemaphoreRelease(g_spi2_semphr);
|
|
}
|
|
}
|
|
} |