fix: defer ch390 exti until rtos is ready

This commit is contained in:
2026-04-29 06:06:26 +08:00
parent 0681b8bbe4
commit 58361589d8
3 changed files with 16 additions and 4 deletions
+6 -2
View File
@@ -2,6 +2,7 @@
#include "stm32f1xx_it.h"
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
#include "app_runtime.h"
@@ -101,8 +102,11 @@ void EXTI0_IRQHandler(void)
if (__HAL_GPIO_EXTI_GET_IT(GPIO_PIN_0) != RESET) {
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_PIN_0);
xSemaphoreGiveFromISR(xNetSemaphore, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
if ((xNetSemaphore != NULL) &&
(xTaskGetSchedulerState() == taskSCHEDULER_RUNNING)) {
xSemaphoreGiveFromISR(xNetSemaphore, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
}