Skip to content

Commit 53eb756

Browse files
committed
Fix formatting and spell check
1 parent a0a249b commit 53eb756

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

include/stack_macros.h

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
/* Stack overflow check is not straight forward to implement for MPU ports
5757
* because of the following reasons:
58-
* 1. The context is stroed in TCB and as a result, pxTopOfStack member points
58+
* 1. The context is stored in TCB and as a result, pxTopOfStack member points
5959
* to the context location in TCB.
6060
* 2. System calls are executed on a separate privileged only stack.
6161
*
@@ -82,37 +82,37 @@
8282
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) && ( portUSING_MPU_WRAPPERS != 1 ) )
8383

8484
/* Only the current stack state is to be checked. */
85-
#define taskCHECK_FOR_STACK_OVERFLOW() \
86-
do \
87-
{ \
88-
/* Is the currently saved stack pointer within the stack limit? */ \
89-
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \
90-
{ \
91-
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
92-
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
93-
} \
85+
#define taskCHECK_FOR_STACK_OVERFLOW() \
86+
do \
87+
{ \
88+
/* Is the currently saved stack pointer within the stack limit? */ \
89+
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \
90+
{ \
91+
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
92+
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
93+
} \
9494
} while( 0 )
9595

9696
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
9797
/*-----------------------------------------------------------*/
9898

9999
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) && ( portUSING_MPU_WRAPPERS != 1 ) )
100100

101-
#define taskCHECK_FOR_STACK_OVERFLOW() \
102-
do \
103-
{ \
104-
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
105-
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \
106-
\
107-
if( ( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) || \
108-
( pulStack[ 0 ] != ulCheckValue ) || \
109-
( pulStack[ 1 ] != ulCheckValue ) || \
110-
( pulStack[ 2 ] != ulCheckValue ) || \
111-
( pulStack[ 3 ] != ulCheckValue ) ) \
112-
{ \
113-
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
114-
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
115-
} \
101+
#define taskCHECK_FOR_STACK_OVERFLOW() \
102+
do \
103+
{ \
104+
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
105+
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \
106+
\
107+
if( ( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) || \
108+
( pulStack[ 0 ] != ulCheckValue ) || \
109+
( pulStack[ 1 ] != ulCheckValue ) || \
110+
( pulStack[ 2 ] != ulCheckValue ) || \
111+
( pulStack[ 3 ] != ulCheckValue ) ) \
112+
{ \
113+
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
114+
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
115+
} \
116116
} while( 0 )
117117

118118
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */

0 commit comments

Comments
 (0)