Remove abundant timer start in timer_settime

xTimerChangePeriod() can make soft timer be active.

Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
This commit is contained in:
wangfei_chen
2025-02-20 11:33:07 +08:00
parent 8339845266
commit 80b98d2ca1

View File

@@ -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 ) )