@@ -781,7 +781,7 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
781781/**
782782 * task. h
783783 * <pre>
784- * void vTaskDelayUntil ( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement );
784+ * BaseType_t xTaskDelayUntil ( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement );
785785 * </pre>
786786 *
787787 * 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;
799799 * each time it executes].
800800 *
801801 * Whereas vTaskDelay () specifies a wake time relative to the time at which the function
802- * is called, vTaskDelayUntil () specifies the absolute (exact) time at which it wishes to
802+ * is called, xTaskDelayUntil () specifies the absolute (exact) time at which it wishes to
803803 * unblock.
804804 *
805805 * 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;
808808 * @param pxPreviousWakeTime Pointer to a variable that holds the time at which the
809809 * task was last unblocked. The variable must be initialised with the current time
810810 * prior to its first use (see the example below). Following this the variable is
811- * automatically updated within vTaskDelayUntil ().
811+ * automatically updated within xTaskDelayUntil ().
812812 *
813813 * @param xTimeIncrement The cycle time period. The task will be unblocked at
814- * time *pxPreviousWakeTime + xTimeIncrement. Calling vTaskDelayUntil with the
814+ * time *pxPreviousWakeTime + xTimeIncrement. Calling xTaskDelayUntil with the
815815 * same xTimeIncrement parameter value will cause the task to execute with
816816 * a fixed interface period.
817817 *
818+ * @return Value which can be used to check whether the task was actually delayed.
819+ * Will be pdTRUE if the task way delayed and pdFALSE otherwise.
820+ *
818821 * Example usage:
819822 * <pre>
820823 * // Perform an action every 10 ticks.
@@ -823,22 +826,28 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
823826 * TickType_t xLastWakeTime;
824827 * const TickType_t xFrequency = 10;
825828 *
826- * // Initialise the xLastWakeTime variable with the current time.
827- * xLastWakeTime = xTaskGetTickCount ();
828- * for( ;; )
829- * {
830- * // Wait for the next cycle.
831- * vTaskDelayUntil ( &xLastWakeTime, xFrequency );
829+ * // Initialise the xLastWakeTime variable with the current time.
830+ * xLastWakeTime = xTaskGetTickCount ();
831+ * for( ;; )
832+ * {
833+ * // Wait for the next cycle.
834+ * BaseType_t xWasDelayed = xTaskDelayUntil ( &xLastWakeTime, xFrequency );
832835 *
833- * // Perform action here.
834- * }
836+ * // Perform action here. xWasDelayed value can be used to determine
837+ * // whether a deadline was missed if the code here took too long.
838+ * }
835839 * }
836840 * </pre>
837- * \defgroup vTaskDelayUntil vTaskDelayUntil
841+ * \defgroup xTaskDelayUntil xTaskDelayUntil
838842 * \ingroup TaskCtrl
839843 */
840- void vTaskDelayUntil ( TickType_t * const pxPreviousWakeTime ,
841- const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION ;
844+ BaseType_t xTaskDelayUntil ( TickType_t * const pxPreviousWakeTime ,
845+ const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION ;
846+ #define vTaskDelayUntil ( pxPreviousWakeTime , xTimeIncrement ) \
847+ { \
848+ xTaskDelayUntil ( pxPreviousWakeTime , xTimeIncrement ); \
849+ }
850+
842851
843852/**
844853 * task. h
0 commit comments