Browse Source

Merge branch 'master' of https://gitee.com/openLuat/LuatOS

alienwalker 3 năm trước cách đây
mục cha
commit
b5bdb773c3
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      components/rtos/freertos/luat_common_freertos.c

+ 6 - 2
components/rtos/freertos/luat_common_freertos.c

@@ -15,6 +15,9 @@
 #include "queue.h"
 #endif
 
+#define LUAT_LOG_TAG "rtos"
+#include "luat_log.h"
+
 typedef struct
 {
 	TaskHandle_t handle;
@@ -127,7 +130,8 @@ int get_event_from_task(void *task_handle, uint32_t target_event_id, OS_EVENT *e
 	int32_t result = ERROR_NONE;
 	uint32_t wait_ms = timeout_ms;
 	task_handle_t *handle = (void *)task_handle;
-	if (xTaskGetCurrentTaskHandle() != handle)
+	int ret = 0;
+	if (xTaskGetCurrentTaskHandle() != handle->handle)
 	{
 		return -1;
 	}
@@ -142,7 +146,7 @@ int get_event_from_task(void *task_handle, uint32_t target_event_id, OS_EVENT *e
 		wait_ms = portMAX_DELAY;
 	}
 GET_NEW_EVENT:
-	if (xQueueReceive(handle->queue, event, wait_ms) != pdTRUE)
+	if ((ret = xQueueReceive(handle->queue, event, wait_ms)) != pdTRUE)
 	{
 		return -ERROR_OPERATION_FAILED;
 	}