fix(openthread): make ot task queue sending non-permanent blocking

This commit is contained in:
zwx
2024-07-09 11:12:31 +08:00
parent ef92aa4aba
commit 943033f9d6
6 changed files with 60 additions and 45 deletions
@@ -21,6 +21,8 @@ static QueueHandle_t s_task_queue = NULL;
static int s_task_queue_event_fd = -1;
static const char *task_queue_workflow = "task_queue";
#define OT_TASK_QUEUE_SENDING_WAIT_TIME pdMS_TO_TICKS(100)
typedef struct {
esp_openthread_task_t task;
void *arg;
@@ -60,7 +62,7 @@ esp_err_t IRAM_ATTR esp_openthread_task_queue_post(esp_openthread_task_t task, v
ESP_RETURN_ON_FALSE_ISR(xQueueSendFromISR(s_task_queue, &task_storage, &task_woken), ESP_FAIL, OT_PLAT_LOG_TAG,
"Failed to post task to OpenThread task queue");
} else {
ESP_RETURN_ON_FALSE(xQueueSend(s_task_queue, &task_storage, portMAX_DELAY), ESP_FAIL, OT_PLAT_LOG_TAG,
ESP_RETURN_ON_FALSE(xQueueSend(s_task_queue, &task_storage, OT_TASK_QUEUE_SENDING_WAIT_TIME), ESP_FAIL, OT_PLAT_LOG_TAG,
"Failed to post task to OpenThread task queue");
}
ret = write(s_task_queue_event_fd, &val, sizeof(val));