43
43
/* Standard includes. */
44
44
#include <stdio.h>
45
45
46
- void exampleTask ( void * parameters )
46
+ /*-----------------------------------------------------------*/
47
+
48
+ static void exampleTask ( void * parameters );
49
+
50
+ /*-----------------------------------------------------------*/
51
+
52
+ static void exampleTask ( void * parameters )
47
53
{
48
54
/* Unused parameters. */
49
55
( void ) parameters ;
@@ -61,15 +67,15 @@ void main( void )
61
67
static StaticTask_t exampleTaskTCB ;
62
68
static StackType_t exampleTaskStack [ configMINIMAL_STACK_SIZE ];
63
69
64
- printf ( "Example FreeRTOS Project\n" );
70
+ ( void ) printf ( "Example FreeRTOS Project\n" );
65
71
66
- xTaskCreateStatic ( exampleTask ,
67
- "example" ,
68
- configMINIMAL_STACK_SIZE ,
69
- NULL ,
70
- configMAX_PRIORITIES - 1 ,
71
- & ( exampleTaskStack [ 0 ] ),
72
- & ( exampleTaskTCB ) );
72
+ ( void ) xTaskCreateStatic ( exampleTask ,
73
+ "example" ,
74
+ configMINIMAL_STACK_SIZE ,
75
+ NULL ,
76
+ configMAX_PRIORITIES - 1U ,
77
+ & ( exampleTaskStack [ 0 ] ),
78
+ & ( exampleTaskTCB ) );
73
79
74
80
/* Start the scheduler. */
75
81
vTaskStartScheduler ();
@@ -81,12 +87,16 @@ void main( void )
81
87
}
82
88
/*-----------------------------------------------------------*/
83
89
84
- void vApplicationStackOverflowHook ( TaskHandle_t xTask ,
85
- char * pcTaskName )
86
- {
87
- /* Check pcTaskName for the name of the offending task,
88
- * or pxCurrentTCB if pcTaskName has itself been corrupted. */
89
- ( void ) xTask ;
90
- ( void ) pcTaskName ;
91
- }
90
+ #if ( configCHECK_FOR_STACK_OVERFLOW > 0 )
91
+
92
+ void vApplicationStackOverflowHook ( TaskHandle_t xTask ,
93
+ char * pcTaskName )
94
+ {
95
+ /* Check pcTaskName for the name of the offending task,
96
+ * or pxCurrentTCB if pcTaskName has itself been corrupted. */
97
+ ( void ) xTask ;
98
+ ( void ) pcTaskName ;
99
+ }
100
+
101
+ #endif /* #if ( configCHECK_FOR_STACK_OVERFLOW > 0 ) */
92
102
/*-----------------------------------------------------------*/
0 commit comments