diff options
author | alfred gedeon <28123637+alfred2g@users.noreply.github.com> | 2021-03-21 19:03:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-21 19:03:38 +0300 |
commit | 9cd19603e8c055e22105e28c2dace4d55b1e420b (patch) | |
tree | bf0ce2c2ac62fb2061f915fa5308f51895e5ec23 /timers.c | |
parent | 6b72419c789dfee9070186f18bd145a2516d9e28 (diff) |
Code: Remove redundant check (#287)
Diffstat (limited to 'timers.c')
-rw-r--r-- | timers.c | 33 |
1 files changed, 15 insertions, 18 deletions
@@ -350,27 +350,24 @@ /* 0 is not a valid value for xTimerPeriodInTicks. */
configASSERT( ( xTimerPeriodInTicks > 0 ) );
- if( pxNewTimer != NULL )
- {
- /* Ensure the infrastructure used by the timer service task has been
- * created/initialised. */
- prvCheckForValidListAndQueue();
-
- /* Initialise the timer structure members using the function
- * parameters. */
- pxNewTimer->pcTimerName = pcTimerName;
- pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;
- pxNewTimer->pvTimerID = pvTimerID;
- pxNewTimer->pxCallbackFunction = pxCallbackFunction;
- vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );
+ /* Ensure the infrastructure used by the timer service task has been
+ * created/initialised. */
+ prvCheckForValidListAndQueue();
- if( uxAutoReload != pdFALSE )
- {
- pxNewTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;
- }
+ /* Initialise the timer structure members using the function
+ * parameters. */
+ pxNewTimer->pcTimerName = pcTimerName;
+ pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;
+ pxNewTimer->pvTimerID = pvTimerID;
+ pxNewTimer->pxCallbackFunction = pxCallbackFunction;
+ vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );
- traceTIMER_CREATE( pxNewTimer );
+ if( uxAutoReload != pdFALSE )
+ {
+ pxNewTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;
}
+
+ traceTIMER_CREATE( pxNewTimer );
}
/*-----------------------------------------------------------*/
|