فهرست منبع

correct portMAX_DELAY

FreeRTOS portMAX_DELAY不是最大的延时时间。需要延时的函数参数为portMAX_DELAY时表示要无限延时。

兼容层实现这些函数时把FreeRTOS参数直接传到RT-Thread函数

```
BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
                              const void * const pvItemToQueue,
                              TickType_t xTicksToWait,
                              const BaseType_t xCopyPosition )
......
err = rt_mq_send_wait( ( rt_mq_t ) pipc, pvItemToQueue, ( ( rt_mq_t ) pipc )->msg_size, ( rt_int32_t ) xTicksToWait );
......
```
所以应该把portMAX_DELAY定义成RT_WAITING_FOREVER,这样RT-Thread函数会做正确的无限延时。
tangzz98 2 سال پیش
والد
کامیت
47436d2ea2
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      FreeRTOS/portable/rt-thread/portmacro.h

+ 1 - 1
FreeRTOS/portable/rt-thread/portmacro.h

@@ -57,7 +57,7 @@
     typedef rt_base_t        BaseType_t;
     typedef rt_ubase_t       UBaseType_t;
     typedef rt_tick_t        TickType_t;
-    #define portMAX_DELAY    ( TickType_t ) ((RT_TICK_MAX / 2) - 1) /* see rt_timer_init and rt_timer_start */
+    #define portMAX_DELAY    ( ( TickType_t ) RT_WAITING_FOREVER )
 
     struct rt_semaphore_wrapper
     {