]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/main.c
Reorganise Zynq project after spitting lwIP example into a separate configuration.
[freertos] / FreeRTOS / Demo / CORTEX_A9_Zynq_ZC702 / RTOSDemo / src / main.c
index 05153b027794ff2a0b3883e1788584e176754051..3738bb75cdd298eeb39877f52aee7755d2616915 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd.\r
+    FreeRTOS V8.0.1 - Copyright (C) 2014 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
     the terms of the GNU General Public License (version 2) as published by the\r
     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
 \r
-    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
-    >>! a combined work that includes FreeRTOS without being obliged to provide\r
-    >>! the source code for proprietary components outside of the FreeRTOS\r
-    >>! kernel.\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
 \r
     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
 */\r
 \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 (defined in this file) is used to\r
- * select between the two.  The simply blinky demo is implemented and described\r
- * in main_blinky.c.  The more comprehensive test and demo application is\r
- * implemented and described in main_full.c.\r
+ * This project provides three demo applications.  A simple blinky style\r
+ * project, a more comprehensive test and demo application, and an lwIP example.\r
+ * The mainSELECTED_APPLICATION setting (defined in this file) is used to\r
+ * select between the three.  The simply blinky demo is implemented and\r
+ * described in main_blinky.c.  The more comprehensive test and demo application\r
+ * is implemented and described in main_full.c.  The lwIP example is implemented\r
+ * and described in main_lwIP.c.\r
  *\r
  * This file implements the code that is not demo specific, including the\r
  * hardware setup and FreeRTOS hook functions.\r
 #include "xscugic.h"\r
 #include "xil_exception.h"\r
 \r
-/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
-or 0 to run the more comprehensive test and demo application. */\r
-#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     0\r
+/* mainSELECTED_APPLICATION is used to select between three demo applications,\r
+ * as described at the top of this file.\r
+ *\r
+ * When mainSELECTED_APPLICATION is set to 0 the simple blinky example will\r
+ * be run.\r
+ *\r
+ * When mainSELECTED_APPLICATION is set to 1 the comprehensive test and demo\r
+ * application will be run.\r
+ *\r
+ * When mainSELECTED_APPLICATION is set to 2 the lwIP example will be run.\r
+ */\r
+#define mainSELECTED_APPLICATION       0\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -123,13 +133,17 @@ or 0 to run the more comprehensive test and demo application. */
 static void prvSetupHardware( void );\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
+ * See the comments at the top of this file and above the\r
+ * mainSELECTED_APPLICATION definition.\r
  */\r
-#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1\r
+#if ( mainSELECTED_APPLICATION == 0 )\r
        extern void main_blinky( void );\r
-#else\r
+#elif ( mainSELECTED_APPLICATION == 1 )\r
        extern void main_full( void );\r
+#elif ( mainSELECTED_APPLICATION == 2 )\r
+       extern void main_lwIP( void );\r
+#else\r
+       #error Invalid mainSELECTED_APPLICATION setting.  See the comments at the top of this file and above the mainSELECTED_APPLICATION definition.\r
 #endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */\r
 \r
 /*\r
@@ -157,19 +171,25 @@ XScuGic xInterruptController;
 \r
 int main( void )\r
 {\r
+extern void main_lwIP( void );\r
+\r
        /* Configure the hardware ready to run the demo. */\r
        prvSetupHardware();\r
 \r
-       /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top\r
+       /* The mainSELECTED_APPLICATION setting is described at the top\r
        of this file. */\r
-       #if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )\r
+       #if( mainSELECTED_APPLICATION == 0 )\r
        {\r
                main_blinky();\r
        }\r
-       #else\r
+       #elif( mainSELECTED_APPLICATION == 1 )\r
        {\r
                main_full();\r
        }\r
+       #else\r
+       {\r
+               main_lwIP();\r
+       }\r
        #endif\r
 \r
        /* Don't expect to reach here. */\r
@@ -277,7 +297,7 @@ volatile unsigned long ul = 0;
 \r
 void vApplicationTickHook( void )\r
 {\r
-       #if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 )\r
+       #if( mainSELECTED_APPLICATION == 1 )\r
        {\r
                /* The full demo includes a software timer demo/test that requires\r
                prodding periodically from the tick interrupt. */\r