]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/WIN32-MSVC/main.c
Add vTaskGetTaskInfo() function that allows a TaskStatus_t structure to be returned...
[freertos] / FreeRTOS / Demo / WIN32-MSVC / main.c
index 53fd61a3e63351a53f0b53b5dd1afe2c3f19d19b..44a935539277c97434e80dff9065e6b08c05f89d 100644 (file)
@@ -154,8 +154,8 @@ void vApplicationMallocFailedHook( void );
 void vApplicationIdleHook( void );\r
 void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );\r
 void vApplicationTickHook( void );\r
-void vApplicationGetIdleTaskMemory( DummyTCB_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint16_t *pusIdleTaskStackSize );\r
-void vApplicationGetTimerTaskMemory( DummyTCB_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint16_t *pusTimerTaskStackSize );\r
+void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint16_t *pusIdleTaskStackSize );\r
+void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint16_t *pusTimerTaskStackSize );\r
 \r
 /*\r
  * Writes trace data to a disk file when the trace recording is stopped.\r
@@ -163,6 +163,15 @@ void vApplicationGetTimerTaskMemory( DummyTCB_t **ppxTimerTaskTCBBuffer, StackTy
  */\r
 static void prvSaveTraceFile( void );\r
 \r
+/*-----------------------------------------------------------*/\r
+\r
+/* When configSUPPORT_STATIC_ALLOCATION is set to 1 the application writer can\r
+use a callback function to optionally provide the memory required by the idle\r
+and timer tasks.  This is the stack that will be used by the timer task.  It is\r
+declared here, as a global, so it can be checked by a test that is implemented\r
+in a different file. */\r
+StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];\r
+\r
 /* The user trace event posted to the trace recording on each tick interrupt.\r
 Note:  This project runs under Windows, and Windows will not be executing the\r
 RTOS threads continuously.  Therefore tick events will not appear with a regular\r
@@ -299,6 +308,15 @@ void vApplicationTickHook( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+void vApplicationDaemonTaskStartupHook( void )\r
+{\r
+       /* This function will be called once only, when the daemon task starts to\r
+       execute (sometimes called the timer task).  This is useful if the\r
+       application includes initialisation code that would benefit from executing\r
+       after the scheduler has been started. */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
 void vAssertCalled( unsigned long ulLine, const char * const pcFileName )\r
 {\r
 static portBASE_TYPE xPrinted = pdFALSE;\r
@@ -392,11 +410,11 @@ const HeapRegion_t xHeapRegions[] =
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vApplicationGetIdleTaskMemory( DummyTCB_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint16_t *pusIdleTaskStackSize )\r
+void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint16_t *pusIdleTaskStackSize )\r
 {\r
 /* The buffers used by the idle task must be static so they are persistent, and\r
 so exist after this function returns. */\r
-static DummyTCB_t xIdleTaskTCB;\r
+static StaticTask_t xIdleTaskTCB;\r
 static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];\r
 \r
        /* configUSE_STATIC_ALLOCATION is set to 1, so the application has the\r
@@ -409,12 +427,13 @@ static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vApplicationGetTimerTaskMemory( DummyTCB_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint16_t *pusTimerTaskStackSize )\r
+void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint16_t *pusTimerTaskStackSize )\r
 {\r
 /* The buffers used by the Timer/Daemon task must be static so they are\r
-persistent, and so exist after this function returns. */\r
-static DummyTCB_t xTimerTaskTCB;\r
-static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];\r
+persistent, and so exist after this function returns.  The stack buffer is\r
+not declared here, but globally, as it is checked by a test in a different\r
+file. */\r
+static StaticTask_t xTimerTaskTCB;\r
 \r
        /* configUSE_STATIC_ALLOCATION is set to 1, so the application has the\r
        opportunity to supply the buffers that will be used by the Timer/RTOS daemon\r