Просмотр исходного кода

Merge pull request #27 from tangzz98/fix

Fix compile errors when configASSERT is defined
tangzz98 3 лет назад
Родитель
Сommit
12b0355247
4 измененных файлов с 17 добавлено и 9 удалено
  1. 2 1
      FreeRTOS/event_groups.c
  2. 7 0
      FreeRTOS/include/task.h
  3. 7 7
      FreeRTOS/queue.c
  4. 1 1
      FreeRTOS/tasks.c

+ 2 - 1
FreeRTOS/event_groups.c

@@ -31,6 +31,7 @@
 
 /* FreeRTOS includes. */
 #include "FreeRTOS.h"
+#include "task.h"
 #include "event_groups.h"
 
 typedef struct EventGroupDef_t
@@ -92,7 +93,7 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
      * itself, and that at least one bit is being requested. */
     configASSERT( xEventGroup );
     configASSERT( uxBitsToWaitFor != 0 );
-    #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
+    #if ( INCLUDE_xTaskGetSchedulerState == 1 )
         {
             configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
         }

+ 7 - 0
FreeRTOS/include/task.h

@@ -112,6 +112,13 @@ typedef struct xTIME_OUT
     TickType_t xTimeOnEntering;
 } TimeOut_t;
 
+/**
+ * Defines the priority used by the idle task.  This must not be modified.
+ *
+ * \ingroup TaskUtils
+ */
+#define tskIDLE_PRIORITY    ( ( UBaseType_t ) 0U )
+
 /**
  * task. h
  *

+ 7 - 7
FreeRTOS/queue.c

@@ -352,7 +352,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
     rt_err_t err = -RT_ERROR;
 
     configASSERT( pxQueue );
-    #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
+    #if ( INCLUDE_xTaskGetSchedulerState == 1 )
         {
             configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
         }
@@ -429,7 +429,7 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
     struct rt_ipc_object *pipc;
     rt_uint8_t type;
     rt_base_t level;
-    rt_err_t err = -RT_ERROR
+    rt_err_t err = -RT_ERROR;
 
     configASSERT( pxQueue );
 
@@ -468,7 +468,7 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
     configASSERT( ( pxQueue ) );
 
     /* Cannot block if the scheduler is suspended. */
-    #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
+    #if ( INCLUDE_xTaskGetSchedulerState == 1 )
         {
             configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
         }
@@ -498,7 +498,7 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
     configASSERT( ( pxQueue ) );
 
     /* Cannot block if the scheduler is suspended. */
-    #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
+    #if ( INCLUDE_xTaskGetSchedulerState == 1 )
         {
             configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
         }
@@ -527,7 +527,7 @@ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
     Queue_t * const pxQueue = xQueue;
     struct rt_ipc_object *pipc;
     rt_uint8_t type;
-    rt_err_t err = -RT_ERROR
+    rt_err_t err = -RT_ERROR;
 
     configASSERT( pxQueue );
 
@@ -690,7 +690,7 @@ BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue )
 {
     BaseType_t xReturn;
 
-    configASSERT( pxQueue );
+    configASSERT( xQueue );
 
     if( uxQueueMessagesWaiting( xQueue ) == ( UBaseType_t ) 0 )
     {
@@ -709,7 +709,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
 {
     BaseType_t xReturn;
 
-    configASSERT( pxQueue );
+    configASSERT( xQueue );
 
     if ( uxQueueSpacesAvailable( xQueue ) == ( UBaseType_t ) 0 )
     {

+ 1 - 1
FreeRTOS/tasks.c

@@ -286,7 +286,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
         rt_thread_t thread = ( rt_thread_t ) xTask;
         rt_base_t level;
 
-        configASSERT( pxTCB );
+        configASSERT( xTask );
 
         level = rt_hw_interrupt_disable();