From 3260e228c3929b50691fe229e6ae522b711688ff Mon Sep 17 00:00:00 2001 From: Spacefish <31589589+rmspacefish@users.noreply.github.com> Date: Fri, 9 Oct 2020 02:46:47 +0200 Subject: [PATCH 1/5] vTaskDelayUntil improvement (#77) * vTaskDelayUntil improvement * suggestions implemented * xTaskDelayUntil #define added * doc small fix * small formatting stuff * more small formatting stuff * Update lexicon.txt Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com> Co-authored-by: Carl Lundin --- include/task.h | 39 ++++++++++++++++++++++++--------------- lexicon.txt | 2 ++ tasks.c | 4 +++- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/include/task.h b/include/task.h index 730deec5a..75e324dde 100644 --- a/include/task.h +++ b/include/task.h @@ -781,7 +781,7 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION; /** * task. h *
- * void vTaskDelayUntil( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement );
+ * BaseType_t xTaskDelayUntil( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement );
  * 
* * INCLUDE_vTaskDelayUntil must be defined as 1 for this function to be available. @@ -799,7 +799,7 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION; * each time it executes]. * * Whereas vTaskDelay () specifies a wake time relative to the time at which the function - * is called, vTaskDelayUntil () specifies the absolute (exact) time at which it wishes to + * is called, xTaskDelayUntil () specifies the absolute (exact) time at which it wishes to * unblock. * * The constant portTICK_PERIOD_MS can be used to calculate real time from the tick @@ -808,13 +808,16 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION; * @param pxPreviousWakeTime Pointer to a variable that holds the time at which the * task was last unblocked. The variable must be initialised with the current time * prior to its first use (see the example below). Following this the variable is - * automatically updated within vTaskDelayUntil (). + * automatically updated within xTaskDelayUntil (). * * @param xTimeIncrement The cycle time period. The task will be unblocked at - * time *pxPreviousWakeTime + xTimeIncrement. Calling vTaskDelayUntil with the + * time *pxPreviousWakeTime + xTimeIncrement. Calling xTaskDelayUntil with the * same xTimeIncrement parameter value will cause the task to execute with * a fixed interface period. * + * @return Value which can be used to check whether the task was actually delayed. + * Will be pdTRUE if the task way delayed and pdFALSE otherwise. + * * Example usage: *
  * // Perform an action every 10 ticks.
@@ -823,22 +826,28 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
  * TickType_t xLastWakeTime;
  * const TickType_t xFrequency = 10;
  *
- *   // Initialise the xLastWakeTime variable with the current time.
- *   xLastWakeTime = xTaskGetTickCount ();
- *   for( ;; )
- *   {
- *       // Wait for the next cycle.
- *       vTaskDelayUntil( &xLastWakeTime, xFrequency );
+ *     // Initialise the xLastWakeTime variable with the current time.
+ *     xLastWakeTime = xTaskGetTickCount ();
+ *	   for( ;; )
+ *	   {
+ *	       // Wait for the next cycle.
+ *		   BaseType_t xWasDelayed = xTaskDelayUntil( &xLastWakeTime, xFrequency );
  *
- *       // Perform action here.
- *   }
+ *		   // Perform action here. xWasDelayed value can be used to determine
+ *		   // whether a deadline was missed if the code here took too long.
+ *     }
  * }
  * 
- * \defgroup vTaskDelayUntil vTaskDelayUntil + * \defgroup xTaskDelayUntil xTaskDelayUntil * \ingroup TaskCtrl */ -void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, - const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION; +BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, + const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION; +#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \ +{ \ + xTaskDelayUntil ( pxPreviousWakeTime , xTimeIncrement ); \ +} + /** * task. h diff --git a/lexicon.txt b/lexicon.txt index 8cb6e9f9b..2e6e9a956 100644 --- a/lexicon.txt +++ b/lexicon.txt @@ -2976,6 +2976,7 @@ xtaskcreate xtaskcreaterestricted xtaskcreaterestrictedstatic xtaskcreatestatic +xtaskdelayuntil xtaskdetails xtaskendscheduler xtaskgetapplicationtasktag @@ -3076,6 +3077,7 @@ xvalueofinsertion xvtorconst xwaitforallbits xwantedsize +xwasdelayed xwritevalue xxr xyieldpending diff --git a/tasks.c b/tasks.c index cbd23b98c..16322e197 100644 --- a/tasks.c +++ b/tasks.c @@ -1246,7 +1246,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) #if ( INCLUDE_vTaskDelayUntil == 1 ) - void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, + BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) { TickType_t xTimeToWake; @@ -1324,6 +1324,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) { mtCOVERAGE_TEST_MARKER(); } + + return xShouldDelay; } #endif /* INCLUDE_vTaskDelayUntil */ From 6375d522507dc2f617b01d616b9b89dae729fcaf Mon Sep 17 00:00:00 2001 From: Joseph Julicher Date: Thu, 8 Oct 2020 18:44:30 -0700 Subject: [PATCH 2/5] matching the preprocessor conditionals for xTaskGetCurrentTaskHandle() (#197) --- portable/Common/mpu_wrappers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portable/Common/mpu_wrappers.c b/portable/Common/mpu_wrappers.c index 60469fcc5..f8d10d756 100644 --- a/portable/Common/mpu_wrappers.c +++ b/portable/Common/mpu_wrappers.c @@ -513,7 +513,7 @@ BaseType_t MPU_xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) /* FREERTOS_SYSTE #endif /*-----------------------------------------------------------*/ -#if ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) +#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 )) TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) /* FREERTOS_SYSTEM_CALL */ { TaskHandle_t xReturn; From 167ea16282dc5537c8b6ddfaefe2965db070a1fc Mon Sep 17 00:00:00 2001 From: RichardBarry <3073890+RichardBarry@users.noreply.github.com> Date: Sat, 10 Oct 2020 21:42:38 -0700 Subject: [PATCH 3/5] Minor updates to formatting and MISRA compliance of the PR used to update the vTaskDelayUntil() function to xTaskDelayUntil(). (#198) --- include/task.h | 57 ++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/include/task.h b/include/task.h index 75e324dde..46b30ca43 100644 --- a/include/task.h +++ b/include/task.h @@ -816,7 +816,8 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION; * a fixed interface period. * * @return Value which can be used to check whether the task was actually delayed. - * Will be pdTRUE if the task way delayed and pdFALSE otherwise. + * Will be pdTRUE if the task way delayed and pdFALSE otherwise. A task will not + * be delayed if the next expected wake time is in the past. * * Example usage: *
@@ -825,27 +826,29 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
  * {
  * TickType_t xLastWakeTime;
  * const TickType_t xFrequency = 10;
+ * BaseType_t xWasDelayed;
  *
  *     // Initialise the xLastWakeTime variable with the current time.
  *     xLastWakeTime = xTaskGetTickCount ();
- *	   for( ;; )
- *	   {
- *	       // Wait for the next cycle.
- *		   BaseType_t xWasDelayed = xTaskDelayUntil( &xLastWakeTime, xFrequency );
+ *     for( ;; )
+ *     {
+ *         // Wait for the next cycle.
+ *         xWasDelayed = xTaskDelayUntil( &xLastWakeTime, xFrequency );
  *
- *		   // Perform action here. xWasDelayed value can be used to determine
- *		   // whether a deadline was missed if the code here took too long.
+ *         // Perform action here. xWasDelayed value can be used to determine
+ *         // whether a deadline was missed if the code here took too long.
  *     }
  * }
  * 
* \defgroup xTaskDelayUntil xTaskDelayUntil * \ingroup TaskCtrl */ -BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, +BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION; -#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \ -{ \ - xTaskDelayUntil ( pxPreviousWakeTime , xTimeIncrement ); \ + +#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \ +{ \ + ( void ) xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); \ } @@ -1594,28 +1597,28 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL #endif #if ( configCHECK_FOR_STACK_OVERFLOW > 0 ) - + /** * task.h *
void vApplicationStackOverflowHook( TaskHandle_t xTask char *pcTaskName); 
- * + * * The application stack overflow hook is called when a stack overflow is detected for a task. - * + * * Details on stack overflow detection can be found here: https://www.FreeRTOS.org/Stacks-and-stack-overflow-checking.html - * + * * @param xTask the task that just exceeded its stack boundaries. * @param pcTaskName A character string containing the name of the offending task. */ void vApplicationStackOverflowHook( TaskHandle_t xTask, - char * pcTaskName ); - -#endif - + char * pcTaskName ); + +#endif + #if ( configUSE_TICK_HOOK > 0 ) - /** + /** * task.h *
void vApplicationTickHook( void ); 
- * + * * This hook function is called in the system tick handler after any OS work is completed. */ void vApplicationTickHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */ @@ -1626,10 +1629,10 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL /** * task.h *
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) 
- * - * This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Idle Task TCB. This function is required when + * + * This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Idle Task TCB. This function is required when * configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION - * + * * @param ppxIdleTaskTCBBuffer A handle to a statically allocated TCB buffer * @param ppxIdleTaskStackBuffer A handle to a statically allocated Stack buffer for thie idle task * @param pulIdleTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer @@ -2467,7 +2470,7 @@ void vTaskGenericNotifyGiveFromISR( TaskHandle_t xTaskToNotify, * task. h *
  * uint32_t ulTaskNotifyTakeIndexed( UBaseType_t uxIndexToWaitOn, BaseType_t xClearCountOnExit, TickType_t xTicksToWait );
- * 
+ *
  * uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait );
  * 
* @@ -2573,7 +2576,7 @@ uint32_t ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn, * task. h *
  * BaseType_t xTaskNotifyStateClearIndexed( TaskHandle_t xTask, UBaseType_t uxIndexToCLear );
- * 
+ *
  * BaseType_t xTaskNotifyStateClear( TaskHandle_t xTask );
  * 
* @@ -2637,7 +2640,7 @@ BaseType_t xTaskGenericNotifyStateClear( TaskHandle_t xTask, * task. h *
  * uint32_t ulTaskNotifyValueClearIndexed( TaskHandle_t xTask, UBaseType_t uxIndexToClear, uint32_t ulBitsToClear );
- * 
+ *
  * uint32_t ulTaskNotifyValueClear( TaskHandle_t xTask, uint32_t ulBitsToClear );
  * 
* From 71be31bb61a4af808bd674b2cd4b70f7fa060676 Mon Sep 17 00:00:00 2001 From: RichardBarry <3073890+RichardBarry@users.noreply.github.com> Date: Sat, 10 Oct 2020 21:47:54 -0700 Subject: [PATCH 4/5] xStreamBufferSend() caps the maximum amount of data a stream buffer can send to the maximum capacity of the buffer - however the value to which the length is capped was wrong, and is correct by this check in. Likewise when sending to a message buffer if the send length is too long the block time is set to 0 to ensure the sending task does not wait indefinitely for the impossible send to complete - but the length check was wrong, and is corrected by this check in. (#195) --- stream_buffer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stream_buffer.c b/stream_buffer.c index c2d600ed5..9dd4ad04e 100644 --- a/stream_buffer.c +++ b/stream_buffer.c @@ -518,6 +518,10 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, size_t xRequiredSpace = xDataLengthBytes; TimeOut_t xTimeOut; + /* The maximum amount of space a stream buffer will ever report is its length + * minus 1. */ + const size_t xMaxReportedSpace = pxStreamBuffer->xLength - ( size_t ) 1; + configASSERT( pvTxData ); configASSERT( pxStreamBuffer ); @@ -534,7 +538,7 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, /* If this is a message buffer then it must be possible to write the * whole message. */ - if( xRequiredSpace > pxStreamBuffer->xLength ) + if( xRequiredSpace > xMaxReportedSpace ) { /* The message would not fit even if the entire buffer was empty, * so don't wait for space. */ @@ -550,9 +554,9 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, /* If this is a stream buffer then it is acceptable to write only part * of the message to the buffer. Cap the length to the total length of * the buffer. */ - if( xRequiredSpace > pxStreamBuffer->xLength ) + if( xRequiredSpace > xMaxReportedSpace ) { - xRequiredSpace = pxStreamBuffer->xLength; + xRequiredSpace = xMaxReportedSpace; } else { From 5fb26de0194b4ebfd09b37128bf9f3ff6d34c1b7 Mon Sep 17 00:00:00 2001 From: RichardBarry <3073890+RichardBarry@users.noreply.github.com> Date: Sun, 11 Oct 2020 14:04:49 -0700 Subject: [PATCH 5/5] Recently vTaskDelayUntil() was updated to xTaskDelayUntil() because the function now returns a value. The PR didn't make the same change in the MPU port, or update the constants required to include the xTaskDelayUntil() function in the build. (#199) This PR: Changes the INCLUDE_vTaskDelayUntil compile time constant to INCLUDE_xTaskDelayUntil. Updates FreeRTOS.h to ensure backward compatibility for projects that already have INCLUDE_vTaskDelayUntil defined. Updates the MPU prototypes, wrapper and implementation to use the updated xTaskDelayUntil() function. Tests to be checked into the FreeRTOS/FreeRTOS repository after this PR. --- include/FreeRTOS.h | 24 ++++++++++++++++++++++-- include/mpu_prototypes.h | 2 +- include/mpu_wrappers.h | 2 +- include/task.h | 14 +++++++++----- portable/Common/mpu_wrappers.c | 10 ++++++---- tasks.c | 12 ++++++------ 6 files changed, 45 insertions(+), 19 deletions(-) diff --git a/include/FreeRTOS.h b/include/FreeRTOS.h index 96cf880a4..e49d11607 100644 --- a/include/FreeRTOS.h +++ b/include/FreeRTOS.h @@ -126,8 +126,28 @@ #define INCLUDE_vTaskSuspend 0 #endif -#ifndef INCLUDE_vTaskDelayUntil - #define INCLUDE_vTaskDelayUntil 0 +#ifdef INCLUDE_xTaskDelayUntil + #ifdef INCLUDE_vTaskDelayUntil + /* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil. Backward + * compatibility is maintained if only one or the other is defined, but + * there is a conflict if both are defined. */ + #error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined. INCLUDE_vTaskDelayUntil is no longer required and should be removed + #endif +#endif + +#ifndef INCLUDE_xTaskDelayUntil + #ifdef INCLUDE_vTaskDelayUntil + /* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then + * the project's FreeRTOSConfig.h probably pre-dates the introduction of + * xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever + * INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility. + */ + #define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil + #endif +#endif + +#ifndef INCLUDE_xTaskDelayUntil + #define INCLUDE_xTaskDelayUntil 0 #endif #ifndef INCLUDE_vTaskDelay diff --git a/include/mpu_prototypes.h b/include/mpu_prototypes.h index d95dcd8c4..b7412b9ca 100644 --- a/include/mpu_prototypes.h +++ b/include/mpu_prototypes.h @@ -58,7 +58,7 @@ void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ) FREERTOS_SYSTEM_CALL; void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL; void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL; -void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, +BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; diff --git a/include/mpu_wrappers.h b/include/mpu_wrappers.h index 6d2f5629d..a217be982 100644 --- a/include/mpu_wrappers.h +++ b/include/mpu_wrappers.h @@ -51,7 +51,7 @@ #define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions #define vTaskDelete MPU_vTaskDelete #define vTaskDelay MPU_vTaskDelay - #define vTaskDelayUntil MPU_vTaskDelayUntil + #define xTaskDelayUntil MPU_xTaskDelayUntil #define xTaskAbortDelay MPU_xTaskAbortDelay #define uxTaskPriorityGet MPU_uxTaskPriorityGet #define eTaskGetState MPU_eTaskGetState diff --git a/include/task.h b/include/task.h index 46b30ca43..bce2a6b8c 100644 --- a/include/task.h +++ b/include/task.h @@ -750,7 +750,7 @@ void vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION; * of controlling the frequency of a periodic task as the path taken through the * code, as well as other task and interrupt activity, will effect the frequency * at which vTaskDelay() gets called and therefore the time at which the task - * next executes. See vTaskDelayUntil() for an alternative API function designed + * next executes. See xTaskDelayUntil() for an alternative API function designed * to facilitate fixed frequency execution. It does this by specifying an * absolute time (rather than a relative time) at which the calling task should * unblock. @@ -784,7 +784,7 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION; * BaseType_t xTaskDelayUntil( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement ); * * - * INCLUDE_vTaskDelayUntil must be defined as 1 for this function to be available. + * INCLUDE_xTaskDelayUntil must be defined as 1 for this function to be available. * See the configuration section for more information. * * Delay a task until a specified time. This function can be used by periodic @@ -802,8 +802,8 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION; * is called, xTaskDelayUntil () specifies the absolute (exact) time at which it wishes to * unblock. * - * The constant portTICK_PERIOD_MS can be used to calculate real time from the tick - * rate - with the resolution of one tick period. + * The macro pdMS_TO_TICKS() can be used to calculate the number of ticks from a + * time specified in milliseconds with a resolution of one tick period. * * @param pxPreviousWakeTime Pointer to a variable that holds the time at which the * task was last unblocked. The variable must be initialised with the current time @@ -846,6 +846,10 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION; BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION; +/* + * vTaskDelayUntil() is the older version of xTaskDelayUntil() and does not + * return a value. + */ #define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \ { \ ( void ) xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); \ @@ -1311,7 +1315,7 @@ void vTaskEndScheduler( void ) PRIVILEGED_FUNCTION; * made. * * API functions that have the potential to cause a context switch (for example, - * vTaskDelayUntil(), xQueueSend(), etc.) must not be called while the scheduler + * xTaskDelayUntil(), xQueueSend(), etc.) must not be called while the scheduler * is suspended. * * Example usage: diff --git a/portable/Common/mpu_wrappers.c b/portable/Common/mpu_wrappers.c index f8d10d756..dea5809e4 100644 --- a/portable/Common/mpu_wrappers.c +++ b/portable/Common/mpu_wrappers.c @@ -171,14 +171,16 @@ void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, #endif /*-----------------------------------------------------------*/ -#if ( INCLUDE_vTaskDelayUntil == 1 ) - void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, - TickType_t xTimeIncrement ) /* FREERTOS_SYSTEM_CALL */ +#if ( INCLUDE_xTaskDelayUntil == 1 ) + BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, + TickType_t xTimeIncrement ) /* FREERTOS_SYSTEM_CALL */ { BaseType_t xRunningPrivileged = xPortRaisePrivilege(); + BaseType_t xReturn; - vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); + xReturn = xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); vPortResetPrivilege( xRunningPrivileged ); + return xReturn; } #endif /*-----------------------------------------------------------*/ diff --git a/tasks.c b/tasks.c index 16322e197..94b3e1f86 100644 --- a/tasks.c +++ b/tasks.c @@ -1244,10 +1244,10 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) #endif /* INCLUDE_vTaskDelete */ /*-----------------------------------------------------------*/ -#if ( INCLUDE_vTaskDelayUntil == 1 ) +#if ( INCLUDE_xTaskDelayUntil == 1 ) BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, - const TickType_t xTimeIncrement ) + const TickType_t xTimeIncrement ) { TickType_t xTimeToWake; BaseType_t xAlreadyYielded, xShouldDelay = pdFALSE; @@ -1324,11 +1324,11 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) { mtCOVERAGE_TEST_MARKER(); } - + return xShouldDelay; } -#endif /* INCLUDE_vTaskDelayUntil */ +#endif /* INCLUDE_xTaskDelayUntil */ /*-----------------------------------------------------------*/ #if ( INCLUDE_vTaskDelay == 1 ) @@ -2100,8 +2100,8 @@ void vTaskStartScheduler( void ) /* Prevent compiler warnings if INCLUDE_xTaskGetIdleTaskHandle is set to 0, * meaning xIdleTaskHandle is not used anywhere else. */ ( void ) xIdleTaskHandle; - - /* OpenOCD makes use of uxTopUsedPriority for thread debugging. Prevent uxTopUsedPriority + + /* OpenOCD makes use of uxTopUsedPriority for thread debugging. Prevent uxTopUsedPriority * from getting optimized out as it is no longer used by the kernel. */ ( void ) uxTopUsedPriority; }