From f2e3d1b0e072131ce59426cbaf692f712051957c Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Wed, 24 Jun 2020 12:30:47 +0200 Subject: [PATCH] suggestions implemented --- include/task.h | 7 ++++--- tasks.c | 7 ++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/task.h b/include/task.h index 96f77ab6c..36d71ab77 100644 --- a/include/task.h +++ b/include/task.h @@ -799,8 +799,8 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION; * same xTimeIncrement parameter value will cause the task to execute with * a fixed interface period. * - * @param xWasDelayed Can be used to check whether the task was actually delayed. - * Will be set to pdTRUE if the task way delayed and to pdFALSE otherwise. + * @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:
@@ -824,7 +824,8 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
  * \defgroup vTaskDelayUntil vTaskDelayUntil
  * \ingroup TaskCtrl
  */
-void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement, BaseType_t * xWasDelayed ) PRIVILEGED_FUNCTION;
+BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION;
+#define vTaskDelayUntil ( pxPreviousWakeTime, xTimeIncrement ) xTaskDelayUntil ( ( xPreviousWakeTime ), ( xTimeIncrement ) )
 
 /**
  * task. h
diff --git a/tasks.c b/tasks.c
index 4862cccc9..ac31a9949 100644
--- a/tasks.c
+++ b/tasks.c
@@ -1251,7 +1251,7 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB )
 
 #if ( INCLUDE_vTaskDelayUntil == 1 )
 
-	void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement, BaseType_t * xWasDelayed )
+	BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement )
 	{
 	TickType_t xTimeToWake;
 	BaseType_t xAlreadyYielded, xShouldDelay = pdFALSE;
@@ -1329,10 +1329,7 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB )
 			mtCOVERAGE_TEST_MARKER();
 		}
 
-		if(xWasDelayed != NULL)
-		{
-			*xWasDelayed = xShouldDelay;
-		}
+		return xShouldDelay;
 	}
 
 #endif /* INCLUDE_vTaskDelayUntil */