|
989 | 989 | traceTIMER_COMMAND_RECEIVED( pxTimer, xMessage.xMessageID, xMessage.u.xTimerParameters.xMessageValue );
|
990 | 990 |
|
991 | 991 | /* In this case the xTimerListsWereSwitched parameter is not used, but
|
992 |
| - * it must be present in the function call. prvSampleTimeNow() must be |
993 |
| - * called after the message is received from xTimerQueue so there is no |
994 |
| - * possibility of a higher priority task adding a message to the message |
995 |
| - * queue with a time that is ahead of the timer daemon task (because it |
996 |
| - * pre-empted the timer daemon task after the xTimeNow value was set). */ |
| 992 | + * it must be present in the function call. prvSampleTimeNow() must be |
| 993 | + * called after the message is received from xTimerQueue so there is no |
| 994 | + * possibility of a higher priority task adding a message to the message |
| 995 | + * queue with a time that is ahead of the timer daemon task (because it |
| 996 | + * pre-empted the timer daemon task after the xTimeNow value was set). */ |
997 | 997 | xTimeNow = prvSampleTimeNow( &xTimerListsWereSwitched );
|
998 | 998 |
|
999 | 999 | switch( xMessage.xMessageID )
|
|
1008 | 1008 | if( prvInsertTimerInActiveList( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) != pdFALSE )
|
1009 | 1009 | {
|
1010 | 1010 | /* The timer expired before it was added to the active
|
1011 |
| - * timer list. Process it now. */ |
| 1011 | + * timer list. Process it now. */ |
1012 | 1012 | if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0U )
|
1013 | 1013 | {
|
1014 | 1014 | prvReloadTimer( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow );
|
|
1042 | 1042 | configASSERT( ( pxTimer->xTimerPeriodInTicks > 0 ) );
|
1043 | 1043 |
|
1044 | 1044 | /* The new period does not really have a reference, and can
|
1045 |
| - * be longer or shorter than the old one. The command time is |
1046 |
| - * therefore set to the current time, and as the period cannot |
1047 |
| - * be zero the next expiry time can only be in the future, |
1048 |
| - * meaning (unlike for the xTimerStart() case above) there is |
1049 |
| - * no fail case that needs to be handled here. */ |
| 1045 | + * be longer or shorter than the old one. The command time is |
| 1046 | + * therefore set to the current time, and as the period cannot |
| 1047 | + * be zero the next expiry time can only be in the future, |
| 1048 | + * meaning (unlike for the xTimerStart() case above) there is |
| 1049 | + * no fail case that needs to be handled here. */ |
1050 | 1050 | ( void ) prvInsertTimerInActiveList( pxTimer, ( xTimeNow + pxTimer->xTimerPeriodInTicks ), xTimeNow, xTimeNow );
|
1051 | 1051 | break;
|
1052 | 1052 |
|
1053 | 1053 | case tmrCOMMAND_DELETE:
|
1054 | 1054 | #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
1055 | 1055 | {
|
1056 | 1056 | /* The timer has already been removed from the active list,
|
1057 |
| - * just free up the memory if the memory was dynamically |
1058 |
| - * allocated. */ |
| 1057 | + * just free up the memory if the memory was dynamically |
| 1058 | + * allocated. */ |
1059 | 1059 | if( ( pxTimer->ucStatus & tmrSTATUS_IS_STATICALLY_ALLOCATED ) == ( uint8_t ) 0 )
|
1060 | 1060 | {
|
1061 | 1061 | vPortFree( pxTimer );
|
|
1068 | 1068 | #else /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
|
1069 | 1069 | {
|
1070 | 1070 | /* If dynamic allocation is not enabled, the memory
|
1071 |
| - * could not have been dynamically allocated. So there is |
1072 |
| - * no need to free the memory - just mark the timer as |
1073 |
| - * "not active". */ |
| 1071 | + * could not have been dynamically allocated. So there is |
| 1072 | + * no need to free the memory - just mark the timer as |
| 1073 | + * "not active". */ |
1074 | 1074 | pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
|
1075 | 1075 | }
|
1076 | 1076 | #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
|
|
0 commit comments