Skip to content

Commit

Permalink
Fix warnings after moving callback prototypes (FreeRTOS#208)
Browse files Browse the repository at this point in the history
* Recently the prototypes for the application hook functions were
moved out of the kernel .c files and into the .h files.  That
changes results in compile time warnings for projects that provide
hook functions with a slightly different prototype - in particular
where signed char * is used in place of just char * as an older
FreeRTOS coding convention required chars to be explicitly qualified
as signed or unsigned.

This checkin fixes the warnings by ensuring the signature of
implemented hook functions matches the signature of the prototypes.
  • Loading branch information
RichardBarry authored Aug 27, 2020
1 parent 4a026fd commit a9680a5
Show file tree
Hide file tree
Showing 23 changed files with 122 additions and 113 deletions.
4 changes: 2 additions & 2 deletions FreeRTOS/Demo/AVR_ATMega4809_Atmel_Studio/RTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main( void )
#elif ( mainSELECTED_APPLICATION == 2 )
main_full();
#endif

return 0;
}

Expand All @@ -78,7 +78,7 @@ This is usefull in application development, for debugging. To use this
hook, uncomment it, and set configCHECK_FOR_STACK_OVERFLOW to 1 in
"FreeRTOSConfig.h" header file. */

// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed char *pcTaskName )
// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, char *pcTaskName )
// {
// for( ;; );
// }
Expand Down
6 changes: 3 additions & 3 deletions FreeRTOS/Demo/AVR_ATMega4809_IAR/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ extern void init_full( void );
int main( void )
{
prvSetupHardware();

#if ( mainSELECTED_APPLICATION == 0 )
main_blinky();
#elif ( mainSELECTED_APPLICATION == 1 )
main_minimal();
#elif ( mainSELECTED_APPLICATION == 2 )
main_full();
#endif

return 0;
}

Expand All @@ -78,7 +78,7 @@ This is usefull in application development, for debugging. To use this
hook, uncomment it, and set configCHECK_FOR_STACK_OVERFLOW to 1 in
"FreeRTOSConfig.h" header file. */

// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed char *pcTaskName )
// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, char *pcTaskName )
// {
// for( ;; );
// }
Expand Down
4 changes: 2 additions & 2 deletions FreeRTOS/Demo/AVR_ATMega4809_MPLAB.X/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main( void )
#elif ( mainSELECTED_APPLICATION == 2 )
main_full();
#endif

return 0;
}

Expand All @@ -78,7 +78,7 @@ This is usefull in application development, for debugging. To use this
hook, uncomment it, and set configCHECK_FOR_STACK_OVERFLOW to 1 in
"FreeRTOSConfig.h" header file. */

// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed char *pcTaskName )
// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, char *pcTaskName )
// {
// for( ;; );
// }
Expand Down
14 changes: 7 additions & 7 deletions FreeRTOS/Demo/AVR_ATmega328PB_Xplained_mini_GCC/RTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ int main(void)
/* Initializes MCU, drivers and middleware.
This is generated from Atmel START project. */
atmel_start_init();

/* Standard register test. */
vStartRegTestTasks();

/* Optionally enable below tests. This port only has 2KB RAM. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
Expand Down Expand Up @@ -102,15 +102,15 @@ BaseType_t xFirstTimeCheck = pdTRUE;
{
uxErrorHasOccurred |= ( 0x01U << 2);
}

/* When check task runs before any other tasks, all above checks shall fail.
To avoid false alarm, clear errors upon first entry. */
if ( xFirstTimeCheck == pdTRUE )
{
uxErrorHasOccurred = 0;
xFirstTimeCheck = pdFALSE;
}

/* Could set break point at below line to verify uxErrorHasOccurred. */
vTaskDelay( mainCHECK_PERIOD );
}
Expand All @@ -126,7 +126,7 @@ static void vBlinkOnboardUserLED( void *pvParameters )
for( ;; )
{
vParTestToggleLED( 0 );

vTaskDelay( mainBLINK_LED_OK_HALF_PERIOD );
}

Expand All @@ -141,9 +141,9 @@ void vApplicationIdleHook( void )

/*-----------------------------------------------------------*/

void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
{
/* When stack overflow happens, trap instead of attempting to recover.
/* When stack overflow happens, trap instead of attempting to recover.
Read input arguments to learn about the offending task. */
for( ;; )
{
Expand Down
4 changes: 2 additions & 2 deletions FreeRTOS/Demo/AVR_Dx_Atmel_Studio/RTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main( void )
#elif ( mainSELECTED_APPLICATION == 2 )
main_full();
#endif

return 0;
}

Expand All @@ -78,7 +78,7 @@ This is usefull in application development, for debugging. To use this
hook, uncomment it, and set configCHECK_FOR_STACK_OVERFLOW to 1 in
"FreeRTOSConfig.h" header file. */

// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed char *pcTaskName )
// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, char *pcTaskName )
// {
// for( ;; );
// }
Expand Down
6 changes: 3 additions & 3 deletions FreeRTOS/Demo/AVR_Dx_IAR/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ extern void init_full( void );
int main( void )
{
prvSetupHardware();

#if ( mainSELECTED_APPLICATION == 0 )
main_blinky();
#elif ( mainSELECTED_APPLICATION == 1 )
main_minimal();
#elif ( mainSELECTED_APPLICATION == 2 )
main_full();
#endif

return 0;
}

Expand All @@ -78,7 +78,7 @@ This is usefull in application development, for debugging. To use this
hook, uncomment it, and set configCHECK_FOR_STACK_OVERFLOW to 1 in
"FreeRTOSConfig.h" header file. */

// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed char *pcTaskName )
// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, char *pcTaskName )
// {
// for( ;; );
// }
Expand Down
2 changes: 1 addition & 1 deletion FreeRTOS/Demo/AVR_Dx_MPLAB.X/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ This is usefull in application development, for debugging. To use this
hook, uncomment it, and set configCHECK_FOR_STACK_OVERFLOW to 1 in
"FreeRTOSConfig.h" header file. */

// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed char *pcTaskName )
// void vApplicationStackOverflowHook(TaskHandle_t *pxTask, char *pcTaskName )
// {
// for( ;; );
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-920242998058162869" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1283716845372686666" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT ARM Cross GCC Built-in Compiler Settings " parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
6 changes: 3 additions & 3 deletions FreeRTOS/Demo/CORTEX_LM3S6965_GCC_QEMU/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ extern void vSetupHighFrequencyTimer( void );
/*
* Hook functions that can get called by the kernel.
*/
void vApplicationStackOverflowHook( TaskHandle_t *pxTask, signed char *pcTaskName );
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );
void vApplicationTickHook( void );

/*
Expand Down Expand Up @@ -379,8 +379,8 @@ void ( *vOLEDClear )( void ) = NULL;
}
/*-----------------------------------------------------------*/

volatile signed char *pcOverflowedTask = NULL; /* Prevent task name being optimised away. */
void vApplicationStackOverflowHook( TaskHandle_t *pxTask, signed char *pcTaskName )
volatile char *pcOverflowedTask = NULL; /* Prevent task name being optimised away. */
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pxTask;
pcOverflowedTask = pcTaskName;
Expand Down
6 changes: 3 additions & 3 deletions FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ extern void vSetupHighFrequencyTimer( void );
/*
* Hook functions that can get called by the kernel.
*/
void vApplicationStackOverflowHook( TaskHandle_t *pxTask, signed char *pcTaskName );
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );
void vApplicationTickHook( void );

static void prvPrintString( const char * pcString );
Expand Down Expand Up @@ -453,8 +453,8 @@ void ( *vOLEDClear )( void ) = NULL;
}
/*-----------------------------------------------------------*/

volatile signed char *pcOverflowedTask = NULL;
void vApplicationStackOverflowHook( TaskHandle_t *pxTask, signed char *pcTaskName )
volatile char *pcOverflowedTask = NULL;
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pxTask;
pcOverflowedTask = pcTaskName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void prvCreateTasks( void )
/*-----------------------------------------------------------*/

/* Stack overflow hook. */
void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
{
/* Force an assert. */
configASSERT( pcTaskName == 0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void prvCreateTasks( void )
/*-----------------------------------------------------------*/

/* Stack overflow hook. */
void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
{
/* Force an assert. */
configASSERT( pcTaskName == 0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void SystemInit( void )
/*-----------------------------------------------------------*/

/* Stack overflow hook. */
void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
{
/* Force an assert. */
configASSERT( pcTaskName == 0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static void prvCreateTasks( void )
/*-----------------------------------------------------------*/

/* Stack overflow hook. */
void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
{
/* Force an assert. */
configASSERT( pcTaskName == 0 );
Expand Down
2 changes: 1 addition & 1 deletion FreeRTOS/Demo/ColdFire_MCF52221_CodeWarrior/sources/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void prvSetupHardware( void )
}
/*-----------------------------------------------------------*/

void vApplicationStackOverflowHook( TaskHandle_t *pxTask, signed char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
/* This will get called if a stack overflow is detected during the context
switch. Set configCHECK_FOR_STACK_OVERFLOWS to 2 to also check for stack
Expand Down
2 changes: 1 addition & 1 deletion FreeRTOS/Demo/ColdFire_MCF52233_Eclipse/RTOSDemo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static const unsigned long _cfm[6] = {
}
/*-----------------------------------------------------------*/

void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )
void vApplicationStackOverflowHook( xTaskHandle pxTask, char *pcTaskName )
{
/* This will get called if a stack overflow is detected during the context
switch. Set configCHECK_FOR_STACK_OVERFLOWS to 2 to also check for stack
Expand Down
2 changes: 1 addition & 1 deletion FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void prvSetupHardware( void )
}
/*-----------------------------------------------------------*/

void vApplicationStackOverflowHook( TaskHandle_t *pxTask, signed char *pcTaskName )
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
/* This will get called if a stack overflow is detected during the context
switch. Set configCHECK_FOR_STACK_OVERFLOWS to 2 to also check for stack
Expand Down
Loading

0 comments on commit a9680a5

Please sign in to comment.