mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 00:37:44 -04:00
Demo/Posix_GCC cleanup (#1212)
Demo/Posix_GCC cleanup - Guard prvSaveTraceFile() function definition. - Remove "cid" as it is unused. - handle_sigint(): quiet compiler warning about unused param. - main_full.c: prvCheckTask(): Remove unused var "xHeapStats". Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
This commit is contained in:
parent
2023ac6404
commit
17eeb79698
2 changed files with 45 additions and 16 deletions
|
@ -91,6 +91,7 @@
|
|||
/* This demo uses heap_3.c (the libc provided malloc() and free()). */
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
extern void main_blinky( void );
|
||||
extern void main_full( void );
|
||||
static void traceOnEnter( void );
|
||||
|
@ -118,12 +119,16 @@ void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
|
|||
StackType_t ** ppxTimerTaskStackBuffer,
|
||||
uint32_t * pulTimerTaskStackSize );
|
||||
|
||||
#if ( projENABLE_TRACING == 1 )
|
||||
|
||||
/*
|
||||
* Writes trace data to a disk file when the trace recording is stopped.
|
||||
* This function will simply overwrite any trace files that already exist.
|
||||
*/
|
||||
static void prvSaveTraceFile( void );
|
||||
|
||||
#endif /* if ( projENABLE_TRACING == 1 ) */
|
||||
|
||||
/*
|
||||
* Signal handler for Ctrl_C to cause the program to exit, and generate the
|
||||
* profiling info.
|
||||
|
@ -139,8 +144,6 @@ static void handle_sigint( int signal );
|
|||
* in a different file. */
|
||||
StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
|
||||
|
||||
static clockid_t cid = CLOCK_THREAD_CPUTIME_ID;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
int main( void )
|
||||
|
@ -183,6 +186,7 @@ int main( void )
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vApplicationMallocFailedHook( void )
|
||||
|
@ -201,6 +205,7 @@ void vApplicationMallocFailedHook( void )
|
|||
* information. */
|
||||
vAssertCalled( __FILE__, __LINE__ );
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vApplicationIdleHook( void )
|
||||
|
@ -227,6 +232,7 @@ void vApplicationIdleHook( void )
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vApplicationStackOverflowHook( TaskHandle_t pxTask,
|
||||
|
@ -242,6 +248,7 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask,
|
|||
* when running the FreeRTOS POSIX port. */
|
||||
vAssertCalled( __FILE__, __LINE__ );
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vApplicationTickHook( void )
|
||||
|
@ -259,6 +266,8 @@ void vApplicationTickHook( void )
|
|||
#endif /* mainSELECTED_APPLICATION */
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void traceOnEnter()
|
||||
{
|
||||
#if ( TRACE_ON_ENTER == 1 )
|
||||
|
@ -286,6 +295,8 @@ void traceOnEnter()
|
|||
#endif /* if ( TRACE_ON_ENTER == 1 ) */
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vLoggingPrintf( const char * pcFormat,
|
||||
... )
|
||||
{
|
||||
|
@ -295,6 +306,7 @@ void vLoggingPrintf( const char * pcFormat,
|
|||
vprintf( pcFormat, arg );
|
||||
va_end( arg );
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vApplicationDaemonTaskStartupHook( void )
|
||||
|
@ -304,6 +316,7 @@ void vApplicationDaemonTaskStartupHook( void )
|
|||
* application includes initialisation code that would benefit from executing
|
||||
* after the scheduler has been started. */
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vAssertCalled( const char * const pcFileName,
|
||||
|
@ -345,9 +358,11 @@ void vAssertCalled( const char * const pcFileName,
|
|||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( projENABLE_TRACING == 1 )
|
||||
|
||||
static void prvSaveTraceFile( void )
|
||||
{
|
||||
FILE * pxOutputFile;
|
||||
|
@ -367,7 +382,9 @@ void vAssertCalled( const char * const pcFileName,
|
|||
printf( "\r\nFailed to create trace dump file\r\n" );
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* if ( projENABLE_TRACING == 1 ) */
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an
|
||||
|
@ -395,6 +412,7 @@ void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
|
|||
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
|
||||
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
|
||||
|
@ -422,11 +440,15 @@ void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
|
|||
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void handle_sigint( int signal )
|
||||
{
|
||||
int xReturn;
|
||||
|
||||
xReturn = chdir( BUILD ); /* changing dir to place gmon.out inside build */
|
||||
( void ) signal;
|
||||
|
||||
xReturn = chdir( BUILD ); /* Changing dir to place gmon.out inside build. */
|
||||
|
||||
if( xReturn == -1 )
|
||||
{
|
||||
|
@ -436,6 +458,8 @@ void handle_sigint( int signal )
|
|||
exit( 2 );
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static uint32_t ulEntryTime = 0;
|
||||
|
||||
void vTraceTimerReset( void )
|
||||
|
@ -443,12 +467,18 @@ void vTraceTimerReset( void )
|
|||
ulEntryTime = xTaskGetTickCount();
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
uint32_t uiTraceTimerGetFrequency( void )
|
||||
{
|
||||
return configTICK_RATE_HZ;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
uint32_t uiTraceTimerGetValue( void )
|
||||
{
|
||||
return( xTaskGetTickCount() - ulEntryTime );
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
@ -269,7 +269,6 @@ static void prvCheckTask( void * pvParameters )
|
|||
{
|
||||
TickType_t xNextWakeTime;
|
||||
const TickType_t xCycleFrequency = pdMS_TO_TICKS( 10000UL );
|
||||
HeapStats_t xHeapStats;
|
||||
|
||||
/* Just to remove compiler warning. */
|
||||
( void ) pvParameters;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue