From 80b98d2ca15e2eb407661f01bd08a030f40aa97c Mon Sep 17 00:00:00 2001 From: wangfei_chen Date: Thu, 20 Feb 2025 11:33:07 +0800 Subject: [PATCH] Remove abundant timer start in timer_settime xTimerChangePeriod() can make soft timer be active. Signed-off-by: wangfei_chen --- FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c index ce94971..4eca283 100755 --- a/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c +++ b/FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c @@ -283,8 +283,7 @@ int timer_settime( timer_t timerid, else { /* Set the timer to expire at the it_value, then start it. */ - ( void ) xTimerChangePeriod( xTimer, xNextTimerExpiration, portMAX_DELAY ); - xTimerCommandSent = xTimerStart( xTimer, xNextTimerExpiration ); + xTimerCommandSent = xTimerChangePeriod( xTimer, xNextTimerExpiration, xNextTimerExpiration ); /* Wait until the timer start command is processed. */ while( ( xTimerCommandSent != pdFAIL ) && ( xTimerIsTimerActive( xTimer ) == pdFALSE ) )