-#include "queue.h"\r
-#include "timers.h"\r
-#include "semphr.h"\r
-\r
-/* Standard demo includes. */\r
-#include "BlockQ.h"\r
-#include "integer.h"\r
-#include "semtest.h"\r
-#include "PollQ.h"\r
-#include "GenQTest.h"\r
-#include "QPeek.h"\r
-#include "recmutex.h"\r
-#include "flop.h"\r
-#include "TimerDemo.h"\r
-#include "countsem.h"\r
-#include "death.h"\r
-#include "dynamic.h"\r
-#include "QueueSet.h"\r
-\r
-/* Priorities at which the tasks are created. */\r
-#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )\r
-#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
-#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
-#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
-#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )\r
-#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
-#define mainuIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
-#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
-#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
-#define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
-\r
-#define mainTIMER_TEST_PERIOD ( 50 )\r
-\r
-/* Task function prototypes. */\r
-static void prvCheckTask( void *pvParameters );\r
-\r
-/* A task that is created from the idle task to test the functionality of \r
-eTaskStateGet(). */\r
-static void prvTestTask( void *pvParameters );\r
-\r
-/* The variable into which error messages are latched. */\r
-static char *pcStatusMessage = "OK";\r
-\r
-/* This semaphore is created purely to test using the vSemaphoreDelete() and\r
-semaphore tracing API functions. It has no other purpose. */\r
-static xSemaphoreHandle xMutexToDelete = NULL;\r
+\r
+/* This project provides two demo applications. A simple blinky style project,\r
+and a more comprehensive test and demo application. The\r
+mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is used to select between the two.\r
+The simply blinky demo is implemented and described in main_blinky.c. The more\r
+comprehensive test and demo application is implemented and described in\r
+main_full.c. */\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0\r
+\r
+/* This demo uses heap_5.c, and these constants define the sizes of the regions\r
+that make up the total heap. This is only done to provide an example of heap_5\r
+being used as this demo could easily create one large heap region instead of\r
+multiple smaller heap regions - in which case heap_4.c would be the more\r
+appropriate choice. */\r
+#define mainREGION_1_SIZE 4001\r
+#define mainREGION_2_SIZE 18105\r
+#define mainREGION_3_SIZE 1807\r
+\r
+/*\r
+ * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
+ * main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.\r
+ */\r
+extern void main_blinky( void );\r
+extern void main_full( void );\r
+\r
+/*\r
+ * Some of the RTOS hook (callback) functions only need special processing when\r
+ * the full demo is being used. The simply blinky demo has no special\r
+ * requirements, so these functions are called from the hook functions defined\r
+ * in this file, but are defined in main_full.c.\r
+ */\r
+void vFullDemoTickHookFunction( void );\r
+void vFullDemoIdleFunction( void );\r
+\r
+/*\r
+ * This demo uses heap_5.c, so start by defining some heap regions. This is\r
+ * only done to provide an example as this demo could easily create one large\r
+ * heap region instead of multiple smaller heap regions - in which case heap_4.c\r
+ * would be the more appropriate choice. No initialisation is required when\r
+ * heap_4.c is used.\r
+ */\r
+static void prvInitialiseHeap( void );\r
+\r
+/*\r
+ * Prototypes for the standard FreeRTOS callback/hook functions implemented\r
+ * within this file.\r
+ */\r
+void vApplicationMallocFailedHook( void );\r
+void vApplicationIdleHook( void );\r
+void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );\r
+void vApplicationTickHook( void );\r
+\r
+/*\r
+ * Writes trace data to a disk file when the trace recording is stopped.\r
+ * This function will simply overwrite any trace files that already exist.\r
+ */\r
+static void prvSaveTraceFile( void );\r
+\r
+/* The user trace event posted to the trace recording on each tick interrupt.\r
+Note tick events will not appear in the trace recording with regular period\r
+because this project runs in a Windows simulator, and does not therefore\r
+exhibit deterministic behaviour. */\r
+traceLabel xTickTraceUserEvent;\r
+static portBASE_TYPE xTraceRunning = pdTRUE;\r