File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
FreeRTOS-Plus-POSIX/source Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ int timer_settime( timer_t timerid,
196196 TimerHandle_t xTimerHandle = timerid ;
197197 timer_internal_t * pxTimer = ( timer_internal_t * ) pvTimerGetTimerID ( xTimerHandle );
198198 TickType_t xNextTimerExpiration = 0 , xTimerExpirationPeriod = 0 ;
199+ BaseType_t xTimerCommandSent = pdFAIL ;
199200
200201 /* Validate the value argument, but only if the timer isn't being disarmed. */
201202 if ( TIMESPEC_IS_NOT_ZERO ( value -> it_value ) )
@@ -283,7 +284,13 @@ int timer_settime( timer_t timerid,
283284 {
284285 /* Set the timer to expire at the it_value, then start it. */
285286 ( void ) xTimerChangePeriod ( xTimerHandle , xNextTimerExpiration , portMAX_DELAY );
286- ( void ) xTimerStart ( xTimerHandle , xNextTimerExpiration );
287+ xTimerCommandSent = xTimerStart ( xTimerHandle , xNextTimerExpiration );
288+
289+ /* Wait until the timer start command is processed. */
290+ while ( ( xTimerCommandSent != pdFAIL ) && ( xTimerIsTimerActive ( xTimerHandle ) == pdFALSE ) )
291+ {
292+ vTaskDelay ( 1 );
293+ }
287294 }
288295 }
289296
You can’t perform that action at this time.
0 commit comments