From a1503ef84ef05a1ad8c9440b58e1313603622402 Mon Sep 17 00:00:00 2001 From: Kristine Jassmann Date: Fri, 18 Jun 2021 20:44:59 +0000 Subject: [PATCH 1/5] Warning fixes. --- tasks.c | 4 ++++ timers.c | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tasks.c b/tasks.c index 5314fccc72f..7670d2a4a98 100644 --- a/tasks.c +++ b/tasks.c @@ -3945,6 +3945,10 @@ static void prvCheckTasksWaitingTermination( void ) * want to allocate and clean RAM statically. */ portCLEAN_UP_TCB( pxTCB ); + /* Remove compiler warning about unused variables when portCLEAN_UP_TCB + * is not being used. */ + ( void ) pxTCB; + /* Free up the memory allocated by the scheduler for the task. It is up * to the task to free any memory allocated at the application level. * See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html diff --git a/timers.c b/timers.c index 7cd6ba2d5a3..c9bd26a5726 100644 --- a/timers.c +++ b/timers.c @@ -67,9 +67,12 @@ #endif /* Bit definitions used in the ucStatus member of a timer structure. */ - #define tmrSTATUS_IS_ACTIVE ( ( uint8_t ) 0x01 ) - #define tmrSTATUS_IS_STATICALLY_ALLOCATED ( ( uint8_t ) 0x02 ) - #define tmrSTATUS_IS_AUTORELOAD ( ( uint8_t ) 0x04 ) + #define tmrSTATUS_IS_ACTIVE ( ( uint8_t ) 0x01 ) + #define tmrSTATUS_IS_STATICALLY_ALLOCATED ( ( uint8_t ) 0x02 ) + #define tmrSTATUS_IS_AUTORELOAD ( ( uint8_t ) 0x04 ) + #define tmrSTATUS_CLEAR_ACTIVE ( ( uint8_t ) ~0x01 ) + #define tmrSTATUS_CLEAR_STATICALLY_ALLOCATED ( ( uint8_t ) ~0x02 ) + #define tmrSTATUS_CLEAR_AUTORELOAD ( ( uint8_t ) ~0x04 ) /* The definition of the timers themselves. */ typedef struct tmrTimerControl /* The old naming convention is used to prevent breaking kernel aware debuggers. */ @@ -462,7 +465,7 @@ } else { - pxTimer->ucStatus &= ~tmrSTATUS_IS_AUTORELOAD; + pxTimer->ucStatus &= tmrSTATUS_CLEAR_AUTORELOAD; } } taskEXIT_CRITICAL(); @@ -550,7 +553,7 @@ } else { - pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE; + pxTimer->ucStatus &= tmrSTATUS_CLEAR_ACTIVE; } /* Call the timer callback. */ @@ -846,7 +849,7 @@ case tmrCOMMAND_STOP: case tmrCOMMAND_STOP_FROM_ISR: /* The timer has already been removed from the active list. */ - pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE; + pxTimer->ucStatus &= tmrSTATUS_CLEAR_ACTIVE; break; case tmrCOMMAND_CHANGE_PERIOD: @@ -885,7 +888,7 @@ * could not have been dynamically allocated. So there is * no need to free the memory - just mark the timer as * "not active". */ - pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE; + pxTimer->ucStatus &= tmrSTATUS_CLEAR_ACTIVE; } #endif /* configSUPPORT_DYNAMIC_ALLOCATION */ break; From c12414879dab1371b47932eb79b239a4693cf748 Mon Sep 17 00:00:00 2001 From: Kristine Jassmann Date: Tue, 20 Jul 2021 02:37:35 +0000 Subject: [PATCH 2/5] Revert change to tasks.c. --- tasks.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tasks.c b/tasks.c index 7670d2a4a98..5314fccc72f 100644 --- a/tasks.c +++ b/tasks.c @@ -3945,10 +3945,6 @@ static void prvCheckTasksWaitingTermination( void ) * want to allocate and clean RAM statically. */ portCLEAN_UP_TCB( pxTCB ); - /* Remove compiler warning about unused variables when portCLEAN_UP_TCB - * is not being used. */ - ( void ) pxTCB; - /* Free up the memory allocated by the scheduler for the task. It is up * to the task to free any memory allocated at the application level. * See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html From 1cc4d978043f091caaf8f25b442f2f3ed32d886a Mon Sep 17 00:00:00 2001 From: Kristine Jassmann Date: Tue, 20 Jul 2021 02:40:33 +0000 Subject: [PATCH 3/5] Remove all empty definitions of portCLEAN_UP_TCB( pxTCB ) and portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) from ports. When these are undefined, the default empty definition is defined in FreeRTOS.h. --- portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portmacro.h | 3 --- .../ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portmacro.h | 3 --- portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portmacro.h | 3 --- .../ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portmacro.h | 3 --- portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portmacro.h | 3 --- .../ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portmacro.h | 3 --- portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portmacro.h | 3 --- .../ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portmacro.h | 3 --- portable/GCC/ARM_CM23/non_secure/portmacro.h | 3 --- portable/GCC/ARM_CM23_NTZ/non_secure/portmacro.h | 3 --- portable/GCC/ARM_CM33/non_secure/portmacro.h | 3 --- portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h | 3 --- portable/IAR/ARM_CM23/non_secure/portmacro.h | 3 --- portable/IAR/ARM_CM23_NTZ/non_secure/portmacro.h | 3 --- portable/IAR/ARM_CM33/non_secure/portmacro.h | 3 --- portable/IAR/ARM_CM33_NTZ/non_secure/portmacro.h | 3 --- portable/ThirdParty/GCC/ARC_EM_HS/portmacro.h | 2 -- portable/ThirdParty/GCC/ARC_v1/portmacro.h | 2 -- portable/ThirdParty/XCC/Xtensa/portmacro.h | 3 --- 19 files changed, 55 deletions(-) diff --git a/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portmacro.h b/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portmacro.h index 3c8b26d6c55..bc715c7881d 100644 --- a/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portmacro.h +++ b/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portmacro.h b/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portmacro.h index 3c8b26d6c55..bc715c7881d 100644 --- a/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portmacro.h +++ b/portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portmacro.h b/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portmacro.h index 451e496ba8b..cc64e610ab2 100644 --- a/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portmacro.h +++ b/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portmacro.h b/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portmacro.h index 451e496ba8b..cc64e610ab2 100644 --- a/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portmacro.h +++ b/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portmacro.h b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portmacro.h index 00ecd4e918a..d7204afe51a 100644 --- a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portmacro.h +++ b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portmacro.h b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portmacro.h index 6bd3ab16142..f9d39f9d0e0 100644 --- a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portmacro.h +++ b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portmacro.h b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portmacro.h index 03cc5151a3d..763798b91f1 100644 --- a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portmacro.h +++ b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portmacro.h b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portmacro.h index 03cc5151a3d..763798b91f1 100644 --- a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portmacro.h +++ b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/GCC/ARM_CM23/non_secure/portmacro.h b/portable/GCC/ARM_CM23/non_secure/portmacro.h index 3c8b26d6c55..bc715c7881d 100644 --- a/portable/GCC/ARM_CM23/non_secure/portmacro.h +++ b/portable/GCC/ARM_CM23/non_secure/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/GCC/ARM_CM23_NTZ/non_secure/portmacro.h b/portable/GCC/ARM_CM23_NTZ/non_secure/portmacro.h index 3c8b26d6c55..bc715c7881d 100644 --- a/portable/GCC/ARM_CM23_NTZ/non_secure/portmacro.h +++ b/portable/GCC/ARM_CM23_NTZ/non_secure/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/GCC/ARM_CM33/non_secure/portmacro.h b/portable/GCC/ARM_CM33/non_secure/portmacro.h index 451e496ba8b..cc64e610ab2 100644 --- a/portable/GCC/ARM_CM33/non_secure/portmacro.h +++ b/portable/GCC/ARM_CM33/non_secure/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h b/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h index 451e496ba8b..cc64e610ab2 100644 --- a/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h +++ b/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/IAR/ARM_CM23/non_secure/portmacro.h b/portable/IAR/ARM_CM23/non_secure/portmacro.h index 00ecd4e918a..d7204afe51a 100644 --- a/portable/IAR/ARM_CM23/non_secure/portmacro.h +++ b/portable/IAR/ARM_CM23/non_secure/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/IAR/ARM_CM23_NTZ/non_secure/portmacro.h b/portable/IAR/ARM_CM23_NTZ/non_secure/portmacro.h index 6bd3ab16142..f9d39f9d0e0 100644 --- a/portable/IAR/ARM_CM23_NTZ/non_secure/portmacro.h +++ b/portable/IAR/ARM_CM23_NTZ/non_secure/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/IAR/ARM_CM33/non_secure/portmacro.h b/portable/IAR/ARM_CM33/non_secure/portmacro.h index 03cc5151a3d..763798b91f1 100644 --- a/portable/IAR/ARM_CM33/non_secure/portmacro.h +++ b/portable/IAR/ARM_CM33/non_secure/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/IAR/ARM_CM33_NTZ/non_secure/portmacro.h b/portable/IAR/ARM_CM33_NTZ/non_secure/portmacro.h index 03cc5151a3d..763798b91f1 100644 --- a/portable/IAR/ARM_CM33_NTZ/non_secure/portmacro.h +++ b/portable/IAR/ARM_CM33_NTZ/non_secure/portmacro.h @@ -264,9 +264,6 @@ * @param[in] pxTCB The TCB of the task being deleted. */ #define portCLEAN_UP_TCB( pxTCB ) vPortFreeSecureContext( ( uint32_t * ) pxTCB ) - #else - #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize ) - #define portCLEAN_UP_TCB( pxTCB ) #endif /* configENABLE_TRUSTZONE */ /*-----------------------------------------------------------*/ diff --git a/portable/ThirdParty/GCC/ARC_EM_HS/portmacro.h b/portable/ThirdParty/GCC/ARC_EM_HS/portmacro.h index 49245bdc7cc..d41ad8534cf 100644 --- a/portable/ThirdParty/GCC/ARC_EM_HS/portmacro.h +++ b/portable/ThirdParty/GCC/ARC_EM_HS/portmacro.h @@ -144,8 +144,6 @@ extern volatile unsigned int ulCriticalNesting; #if defined( __MW__ ) extern void task_end_hook( void * pxTCB ); #define portCLEAN_UP_TCB( pxTCB ) task_end_hook( ( void * ) pxTCB ) -#else - #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB #endif void vPortYield( void ); diff --git a/portable/ThirdParty/GCC/ARC_v1/portmacro.h b/portable/ThirdParty/GCC/ARC_v1/portmacro.h index 5034b11e428..d8850e75897 100644 --- a/portable/ThirdParty/GCC/ARC_v1/portmacro.h +++ b/portable/ThirdParty/GCC/ARC_v1/portmacro.h @@ -138,8 +138,6 @@ #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() do {} while( 0 ) /* we use the timer */ #define portALT_GET_RUN_TIME_COUNTER_VALUE( dest ) ( dest = xTickCount ) - #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB - void vPortYield( void ); void vPortYieldFromIsr( void ); diff --git a/portable/ThirdParty/XCC/Xtensa/portmacro.h b/portable/ThirdParty/XCC/Xtensa/portmacro.h index 98059da8ea1..6453e4a5b45 100644 --- a/portable/ThirdParty/XCC/Xtensa/portmacro.h +++ b/portable/ThirdParty/XCC/Xtensa/portmacro.h @@ -182,9 +182,6 @@ void exit(int); #if (XT_USE_THREAD_SAFE_CLIB > 0u) && (XSHAL_CLIB == XTHAL_CLIB_XCLIB) extern void vPortClibInit(void); - -// No cleanup necessary at this time. -#define portCLEAN_UP_TCB(pxTCB) #endif // XCLIB support #if (XT_USE_THREAD_SAFE_CLIB > 0u) && (XSHAL_CLIB == XTHAL_CLIB_NEWLIB) From 2d1f575fe8c0df4ab3a62f7f80dfc5881aee7667 Mon Sep 17 00:00:00 2001 From: Kristine Jassmann Date: Tue, 20 Jul 2021 02:42:08 +0000 Subject: [PATCH 4/5] Use cast to fix warnings. --- timers.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/timers.c b/timers.c index c9bd26a5726..5cdd36d688d 100644 --- a/timers.c +++ b/timers.c @@ -67,12 +67,9 @@ #endif /* Bit definitions used in the ucStatus member of a timer structure. */ - #define tmrSTATUS_IS_ACTIVE ( ( uint8_t ) 0x01 ) - #define tmrSTATUS_IS_STATICALLY_ALLOCATED ( ( uint8_t ) 0x02 ) - #define tmrSTATUS_IS_AUTORELOAD ( ( uint8_t ) 0x04 ) - #define tmrSTATUS_CLEAR_ACTIVE ( ( uint8_t ) ~0x01 ) - #define tmrSTATUS_CLEAR_STATICALLY_ALLOCATED ( ( uint8_t ) ~0x02 ) - #define tmrSTATUS_CLEAR_AUTORELOAD ( ( uint8_t ) ~0x04 ) + #define tmrSTATUS_IS_ACTIVE ( ( uint8_t ) 0x01 ) + #define tmrSTATUS_IS_STATICALLY_ALLOCATED ( ( uint8_t ) 0x02 ) + #define tmrSTATUS_IS_AUTORELOAD ( ( uint8_t ) 0x04 ) /* The definition of the timers themselves. */ typedef struct tmrTimerControl /* The old naming convention is used to prevent breaking kernel aware debuggers. */ @@ -465,7 +462,7 @@ } else { - pxTimer->ucStatus &= tmrSTATUS_CLEAR_AUTORELOAD; + pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_AUTORELOAD ); } } taskEXIT_CRITICAL(); @@ -553,7 +550,7 @@ } else { - pxTimer->ucStatus &= tmrSTATUS_CLEAR_ACTIVE; + pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); } /* Call the timer callback. */ @@ -832,7 +829,7 @@ } else { - pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE; + pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); } /* Call the timer callback. */ @@ -849,7 +846,7 @@ case tmrCOMMAND_STOP: case tmrCOMMAND_STOP_FROM_ISR: /* The timer has already been removed from the active list. */ - pxTimer->ucStatus &= tmrSTATUS_CLEAR_ACTIVE; + pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); break; case tmrCOMMAND_CHANGE_PERIOD: @@ -879,7 +876,7 @@ } else { - pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE; + pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); } } #else /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */ @@ -888,7 +885,7 @@ * could not have been dynamically allocated. So there is * no need to free the memory - just mark the timer as * "not active". */ - pxTimer->ucStatus &= tmrSTATUS_CLEAR_ACTIVE; + pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); } #endif /* configSUPPORT_DYNAMIC_ALLOCATION */ break; From cf557a1112133b82a7893126799b0268775f9662 Mon Sep 17 00:00:00 2001 From: Kristine Jassmann Date: Tue, 20 Jul 2021 18:52:03 +0000 Subject: [PATCH 5/5] Coding standard fix. --- timers.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/timers.c b/timers.c index 5cdd36d688d..b3e89aa29ad 100644 --- a/timers.c +++ b/timers.c @@ -462,7 +462,7 @@ } else { - pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_AUTORELOAD ); + pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_AUTORELOAD ); } } taskEXIT_CRITICAL(); @@ -550,7 +550,7 @@ } else { - pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); + pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); } /* Call the timer callback. */ @@ -829,7 +829,7 @@ } else { - pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); + pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); } /* Call the timer callback. */ @@ -846,7 +846,7 @@ case tmrCOMMAND_STOP: case tmrCOMMAND_STOP_FROM_ISR: /* The timer has already been removed from the active list. */ - pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); + pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); break; case tmrCOMMAND_CHANGE_PERIOD: @@ -876,7 +876,7 @@ } else { - pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); + pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); } } #else /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */ @@ -885,7 +885,7 @@ * could not have been dynamically allocated. So there is * no need to free the memory - just mark the timer as * "not active". */ - pxTimer->ucStatus &= ( (uint8_t) ~tmrSTATUS_IS_ACTIVE ); + pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); } #endif /* configSUPPORT_DYNAMIC_ALLOCATION */ break;