]> git.sur5r.net Git - freertos/commitdiff
Move the MSVC/lwIP code into the main line - not yet tested since moved.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 1 Aug 2011 10:58:22 +0000 (10:58 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 1 Aug 2011 10:58:22 +0000 (10:58 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1531 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/WIN32-MSVC-lwIP/WIN32.vcxproj
Demo/WIN32-MSVC-lwIP/WIN32.vcxproj.filters
Demo/WIN32-MSVC-lwIP/lwIP_Apps/apps/BasicSocketCommandServer/BasicSocketCommandServer.c
Demo/WIN32-MSVC-lwIP/lwIP_Apps/lwIP_Apps.c
Demo/WIN32-MSVC-lwIP/main.c

index 886b0cf4aad6506b6c01c1c5eb0c2236ebed9288..a4a21d36c9ca9fbbcdd764767db9bd465e7c9758 100644 (file)
@@ -54,7 +54,7 @@
     </Midl>\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap;..\Common\ethernet\lwip-1.4.0\src\include\ipv4;..\Common\ethernet\lwip-1.4.0\src\include;..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\ethernet\lwip-1.4.0\ports\win32\include;..\Common\Include;.\lwIP_Apps;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>..\Common\Utils;..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap;..\Common\ethernet\lwip-1.4.0\src\include\ipv4;..\Common\ethernet\lwip-1.4.0\src\include;..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\ethernet\lwip-1.4.0\ports\win32\include;..\Common\Include;.\lwIP_Apps;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>_WINSOCKAPI_;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
     <ClCompile Include="..\Common\ethernet\lwip-1.4.0\src\core\tcp_out.c" />\r
     <ClCompile Include="..\Common\ethernet\lwip-1.4.0\src\core\udp.c" />\r
     <ClCompile Include="..\Common\ethernet\lwip-1.4.0\src\netif\etharp.c" />\r
-    <ClCompile Include="..\Common\Minimal\BlockQ.c" />\r
-    <ClCompile Include="..\Common\Minimal\blocktim.c" />\r
-    <ClCompile Include="..\Common\Minimal\countsem.c" />\r
-    <ClCompile Include="..\Common\Minimal\flop.c" />\r
     <ClCompile Include="..\Common\Minimal\GenQTest.c" />\r
-    <ClCompile Include="..\Common\Minimal\integer.c" />\r
-    <ClCompile Include="..\Common\Minimal\PollQ.c" />\r
-    <ClCompile Include="..\Common\Minimal\QPeek.c" />\r
-    <ClCompile Include="..\Common\Minimal\semtest.c" />\r
-    <ClCompile Include="..\Common\Minimal\timerdemo.c" />\r
     <ClCompile Include="..\Common\Utils\CommandInterpreter.c" />\r
-    <ClCompile Include="DemosModifiedForLowTickRate\recmutex.c" />\r
-    <ClCompile Include="lwIP_Apps\apps\httpserver_raw\fs.c" />\r
-    <ClCompile Include="lwIP_Apps\apps\httpserver_raw\httpd.c" />\r
-    <ClCompile Include="lwIP_Apps\BasicSocketCommandServer.c" />\r
+    <ClCompile Include="lwIP_Apps\apps\BasicSocketCommandServer\BasicSocketCommandServer.c" />\r
+    <ClCompile Include="lwIP_Apps\apps\httpserver_raw_from_lwIP_download\fs.c" />\r
+    <ClCompile Include="lwIP_Apps\apps\httpserver_raw_from_lwIP_download\httpd.c" />\r
     <ClCompile Include="lwIP_Apps\lwIP_Apps.c" />\r
     <ClCompile Include="main.c">\r
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
index b0258784940a21229fd573cbb3050d0bdcc07b11..6914b100333d5a8323bfa58cfb885319ffb74ca6 100644 (file)
@@ -25,9 +25,6 @@
     <Filter Include="FreeRTOS Source\Source\Portable">\r
       <UniqueIdentifier>{88f409e6-d396-4ac5-94bd-7a99c914be46}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Demo App Source\Common Demo Tasks\ModifiedForLowTickRate">\r
-      <UniqueIdentifier>{143cf5a3-f134-4439-9f71-a201ae23b44b}</UniqueIdentifier>\r
-    </Filter>\r
     <Filter Include="Configuration Files">\r
       <UniqueIdentifier>{19ff1a34-36de-4c48-9d10-3fb1fa0d1fa4}</UniqueIdentifier>\r
       <Extensions>h;hpp;hxx;hm;inl</Extensions>\r
     <Filter Include="lwIP_Apps">\r
       <UniqueIdentifier>{c3366d35-95df-4c03-a752-3ae631ec6bba}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="lwIP_Apps\httpd_raw">\r
+    <Filter Include="lwIP_Apps\BasicSocketCommandServer">\r
+      <UniqueIdentifier>{92b32a46-5658-4c53-b5de-3b174955a777}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="lwIP_Apps\httpd_raw_from_lwIP_download">\r
       <UniqueIdentifier>{6c4a261d-ca37-4528-ad50-8f04032898cb}</UniqueIdentifier>\r
     </Filter>\r
   </ItemGroup>\r
     <ClCompile Include="..\..\Source\portable\MSVC-MingW\port.c">\r
       <Filter>FreeRTOS Source\Source\Portable</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\Common\Minimal\flop.c">\r
-      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\Common\Minimal\GenQTest.c">\r
       <Filter>Demo App Source\Common Demo Tasks</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\Common\Minimal\integer.c">\r
-      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\Common\Minimal\PollQ.c">\r
-      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\Common\Minimal\QPeek.c">\r
-      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\Common\Minimal\semtest.c">\r
-      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\Common\Minimal\BlockQ.c">\r
-      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\Common\Minimal\blocktim.c">\r
-      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="DemosModifiedForLowTickRate\recmutex.c">\r
-      <Filter>Demo App Source\Common Demo Tasks\ModifiedForLowTickRate</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\Source\timers.c">\r
       <Filter>FreeRTOS Source\Source</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\Common\Minimal\timerdemo.c">\r
-      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\Common\Minimal\countsem.c">\r
-      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\Common\ethernet\lwip-1.4.0\src\api\tcpip.c">\r
       <Filter>lwIP\Source\API</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\Common\ethernet\lwip-1.4.0\src\core\snmp\msg_in.c">\r
       <Filter>lwIP\Source\Core\SNMP</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="lwIP_Apps\apps\httpserver_raw\httpd.c">\r
-      <Filter>lwIP_Apps\httpd_raw</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="lwIP_Apps\apps\httpserver_raw\fs.c">\r
-      <Filter>lwIP_Apps\httpd_raw</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="lwIP_Apps\lwIP_Apps.c">\r
       <Filter>lwIP_Apps</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="lwIP_Apps\BasicSocketCommandServer.c">\r
-      <Filter>lwIP_Apps</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\Common\Utils\CommandInterpreter.c">\r
       <Filter>Demo App Source</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="lwIP_Apps\apps\BasicSocketCommandServer\BasicSocketCommandServer.c">\r
+      <Filter>lwIP_Apps\BasicSocketCommandServer</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="lwIP_Apps\apps\httpserver_raw_from_lwIP_download\httpd.c">\r
+      <Filter>lwIP_Apps\httpd_raw_from_lwIP_download</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="lwIP_Apps\apps\httpserver_raw_from_lwIP_download\fs.c">\r
+      <Filter>lwIP_Apps\httpd_raw_from_lwIP_download</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="FreeRTOSConfig.h">\r
index 4b66789710e62dd85ae695c8c6460221c32e8e75..85a722a36f9734cb068e93c46414ccec4b848965 100644 (file)
@@ -66,6 +66,7 @@
 #include "CommandInterpreter.h"\r
 \r
 #define cmdMAX_INPUT_SIZE      20\r
+\r
 /*-----------------------------------------------------------*/\r
 \r
 void vBasicTelnetServer( void *pvParameters )\r
@@ -133,7 +134,7 @@ signed char cInputString[ cmdMAX_INPUT_SIZE ];
                                                        {\r
                                                                /* The input string was not a quit command.  \r
                                                                Pass the string to the command interpreter. */\r
-                                                               while( ( pcString = pcProcessCommand( cInputString ) ) != NULL )\r
+                                                               while( ( pcString = pcCmdIntProcessCommand( cInputString ) ) != NULL )\r
                                                                {\r
                                                                        /* A string has been generated by the \r
                                                                        command interpreter.  Send it. */\r
index 1adc74d1e42d3de40654cde4152869287bf979d6..aa186b34d2b334b6e5302233ed5b3d6c0770fdee 100644 (file)
 #include "netif/etharp.h"\r
 \r
 /* applications includes */\r
-#include "apps/httpserver_raw/httpd.h"\r
-#include "apps/httpserver/httpserver-netconn.h"\r
-#include "apps/netio/netio.h"\r
-#include "apps/netbios/netbios.h"\r
-#include "apps/ping/ping.h"\r
-#include "apps/rtp/rtp.h"\r
-#include "apps/sntp/sntp.h"\r
-#include "apps/chargen/chargen.h"\r
-#include "apps/shell/shell.h"\r
-#include "apps/tcpecho/tcpecho.h"\r
-#include "apps/udpecho/udpecho.h"\r
-#include "apps/tcpecho_raw/echo.h"\r
-#include "apps/socket_examples/socket_examples.h"\r
+#include "apps/httpserver_raw_from_lwIP_download/httpd.h"\r
 \r
 /* include the port-dependent configuration */\r
 #include "lwipcfg_msvc.h"\r
@@ -149,67 +137,12 @@ extern err_t ethernetif_init( struct netif *netif );
 /* This function initializes applications */\r
 static void apps_init( void )\r
 {\r
-       /* Taken from the lwIP example code. */\r
-       \r
-       #if LWIP_DNS_APP && LWIP_DNS\r
-               /* wait until the netif is up (for dhcp, autoip or ppp) */\r
-               sys_timeout(5000, dns_dorequest, NULL);\r
-       #endif /* LWIP_DNS_APP && LWIP_DNS */\r
-\r
-       #if LWIP_CHARGEN_APP && LWIP_SOCKET\r
-               chargen_init();\r
-       #endif /* LWIP_CHARGEN_APP && LWIP_SOCKET */\r
-\r
-       #if LWIP_PING_APP && LWIP_RAW && LWIP_ICMP\r
-               ping_init();\r
-       #endif /* LWIP_PING_APP && LWIP_RAW && LWIP_ICMP */\r
-\r
-       #if LWIP_NETBIOS_APP && LWIP_UDP\r
-               netbios_init();\r
-       #endif /* LWIP_NETBIOS_APP && LWIP_UDP */\r
-\r
-       #if LWIP_HTTPD_APP && LWIP_TCP\r
-       {\r
-               #ifdef LWIP_HTTPD_APP_NETCONN\r
-                       http_server_netconn_init();\r
-               #else /* LWIP_HTTPD_APP_NETCONN */\r
-                       httpd_init();\r
-               #endif /* LWIP_HTTPD_APP_NETCONN */\r
-       }\r
-       #endif /* LWIP_HTTPD_APP && LWIP_TCP */\r
-\r
-       #if LWIP_NETIO_APP && LWIP_TCP\r
-               netio_init();\r
-       #endif /* LWIP_NETIO_APP && LWIP_TCP */\r
-\r
-       #if LWIP_RTP_APP && LWIP_SOCKET && LWIP_IGMP\r
-               rtp_init();\r
-       #endif /* LWIP_RTP_APP && LWIP_SOCKET && LWIP_IGMP */\r
-\r
-       #if LWIP_SNTP_APP && LWIP_SOCKET\r
-               sntp_init();\r
-       #endif /* LWIP_SNTP_APP && LWIP_SOCKET */\r
-\r
-       #if LWIP_SHELL_APP && LWIP_NETCONN\r
-               shell_init();\r
-       #endif /* LWIP_SHELL_APP && LWIP_NETCONN */\r
-\r
-       #if LWIP_TCPECHO_APP\r
-               #if LWIP_NETCONN && defined(LWIP_TCPECHO_APP_NETCONN)\r
-                       tcpecho_init();\r
-               #else /* LWIP_NETCONN && defined(LWIP_TCPECHO_APP_NETCONN) */\r
-                       echo_init();\r
-               #endif\r
-       #endif /* LWIP_TCPECHO_APP && LWIP_NETCONN */\r
-\r
-       #if LWIP_UDPECHO_APP && LWIP_NETCONN\r
-               udpecho_init();\r
-       #endif /* LWIP_UDPECHO_APP && LWIP_NETCONN */\r
-       \r
-       #if LWIP_SOCKET_EXAMPLES_APP && LWIP_SOCKET\r
-               socket_examples_init();\r
-       #endif /* LWIP_SOCKET_EXAMPLES_APP && LWIP_SOCKET */\r
+       /* Create the httpd server from the standard lwIP code.  This demonstrates\r
+       use of the lwIP raw API. */\r
+       httpd_init();\r
 \r
+       /* Create the FreeRTOS defined basic command server.  This demonstrates use\r
+       of the lwIP sockets API. */\r
        xTaskCreate( vBasicTelnetServer, ( signed char * ) "Telnet", configMINIMAL_STACK_SIZE * 10, NULL, configMAX_PRIORITIES - 2, NULL );\r
 }\r
 /*-----------------------------------------------------------*/\r
index 2cfa1e96fa8fa5d1b583e6d0bbe6a2d3697f57f5..85a658a98629873c7504920fdfa58bfce708a3a5 100644 (file)
  *\r
  * - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT -\r
  * - http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
+ * - Note that the above linked page describes the simulator environment.  It\r
+ * - is not the correct page to view for information on using this lwIP demo.\r
  *******************************************************************************\r
  *\r
- * main() creates all the demo application tasks, then starts the scheduler.  \r
- * The web documentation provides more details of the standard demo application \r
- * tasks, which provide no particular functionality but do provide a good \r
- * example of how to use the FreeRTOS API.\r
+ * This project demonstrates use of the lwIP stack.  The lwIP raw API is \r
+ * demonstrated by a simple http server that comes as part of the lwIP \r
+ * distribution - and executes in the tcpip task.  The lwIP sockets API\r
+ * is demonstrated by a simple command line interpreter interface, which\r
+ * executes in its own task.\r
  *\r
- * In addition to the standard demo tasks, the following tasks and tests are\r
- * defined and/or created within this file:\r
+ * Both the http and command line server can be used to view task stats, and\r
+ * run time stats.  Task stats give a snapshot of the state of each task in\r
+ * the system.  Run time stats show how much processing time has been allocated\r
+ * to each task.  A few of the standard demo tasks are created, just to ensure\r
+ * there is some data to be viewed.\r
  *\r
- * "Check" task - This only executes every five seconds but has a high priority\r
- * to ensure it gets processor time.  Its main function is to check that all the\r
- * standard demo tasks are still operational.  While no errors have been\r
- * discovered the check task will print out "OK" and the current simulated tick\r
- * time.  If an error is discovered in the execution of a task then the check\r
- * task will print out an appropriate error message.\r
+ * Finally, a check timer is created.  The check timer is a software timer that\r
+ * inspects the few standard demo tasks that are created to ensure they are\r
+ * executing as expected.  It maintains a status string that can be viewed on\r
+ * the "task stats" page served by the web server.\r
  *\r
- * lwIP - This project also includes a simple lwIP example.  The implements a\r
- * web server that includes Server Side Include (SSI) functionality.  The web\r
- * server serves a page that shows task statistics, and another page that shows\r
- * run time statistics (how much CPU time each task is consuming).  Following\r
- * are some notes on the web server functionality:\r
- * - Configuration parameters (IP address, etc.) are set at the bottom of\r
- *   FreeRTOSConfig.h.  In particular, the number of the WinPCap interface to\r
- *   open is set by the configNETWORK_INTERFACE_TO_USE parameter.\r
- * - A WinPCap driver is provided in \r
- *   FreeRTOS\Demo\Common\ethernet\lwip-1.4.0\ports\win32\ethernetif.c.\r
- * - Currently, the files served by the web server are converted into C structs,\r
- *   and built into the executable image.  The html and image files are converted\r
- *   to C structs using the makefsdata.exe binary found in\r
- *   FreeRTOS\Demo\WIN32-MSVC\lwIP_Apps\apps\httpserver_raw\makefsdata.  A\r
- *   Microsoft Visual Studio Express 10 project file that builds the .exe is\r
- *   located in the same directory.\r
- * - Makefsdata.exe outputs a file called fsdata.c.  fsdata.c must be copied\r
- *   into FreeRTOS\Demo\WIN32-MSVC\lwIP_Apps\apps\httpserver_raw prior to the\r
- *   project being built.\r
- * - The SSI generator functions are located in \r
- *   FreeRTOS\Demo\WIN32-MSVC\lwIP_Apps\lwIP_Apps.c\r
+ * More information about this demo, including details of how to set up the \r
+ * network interface, and the command line commands that are available, is\r
+ * available on the documentation page for this demo on the \r
+ * http://www.FreeRTOS.org web site.\r
  *\r
  */\r
 \r
 /* Kernel includes. */\r
 #include <FreeRTOS.h>\r
 #include "task.h"\r
-#include "queue.h"\r
+#include "timers.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
 \r
 /* lwIP includes. */\r
 #include "lwip/tcpip.h"\r
 #include "CommandInterpreter.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
+/* The period at which the check timer will expire, in ms, provided no errors\r
+have been reported by any of the standard demo tasks.  ms are converted to the\r
+equivalent in ticks using the portTICK_RATE_MS constant. */\r
+#define mainCHECK_TIMER_PERIOD_MS                      ( 3000UL / portTICK_RATE_MS )\r
 \r
-/* Task function prototypes. */\r
-static void prvCheckTask( void *pvParameters );\r
+/* Check timer callback function. */\r
+static void prvCheckTimerCallback( xTimerHandle xTimer );\r
 \r
 /* Defined in lwIPApps.c. */\r
 extern void lwIPAppsInit( void *pvArguments );\r
@@ -162,13 +134,16 @@ static char *pcStatusMessage = "All tasks running without error";
 stats record how much time each task spends in the Running state. */\r
 long long llInitialRunTimeCounterValue = 0LL, llRunTimeStatsDivisor = 0LL;\r
 \r
+/* The check timer.  This uses prvCheckTimerCallback() as its callback\r
+function. */\r
+static xTimerHandle xCheckTimer = NULL;\r
+\r
 /* Structure that defines the "run-time-stats" command line command. */\r
 static const xCommandLineInput xRunTimeStats =\r
 {\r
        "run-time-stats",\r
        "run-time-stats: Displays a table showing how much processing time each FreeRTOS task has used\r\n",\r
        prvRunTimeStatsCommand,\r
-       NULL\r
 };\r
 \r
 /* Structure that defines the "task-stats" command line command. */\r
@@ -177,110 +152,67 @@ static const xCommandLineInput xTaskStats =
        "task-stats",\r
        "task-stats: Displays a table showing the state of each FreeRTOS task\r\n",\r
        prvTaskStatsCommand,\r
-       &xRunTimeStats\r
 };\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
 int main( void )\r
 {\r
+const unsigned long ulLongTime_ms = 1000UL;\r
+\r
        /* This call creates the TCP/IP thread. */\r
        tcpip_init( lwIPAppsInit, NULL );\r
 \r
-       #if configINCLUDE_STANDARD_DEMO_TASKS == 1\r
-       {\r
-               /* Start the check task as described at the top of this file. */\r
-               xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
-\r
-               /* Create the standard demo tasks. */\r
-               vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
-               vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
-               vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
-               vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );\r
-               vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
-               vStartQueuePeekTasks();\r
-               vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
-               vStartRecursiveMutexTasks();\r
-               vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
-               vStartCountingSemaphoreTasks();\r
-       }\r
-       #endif\r
+       /* Create and start the check timer, as described at the top of this file. */\r
+       xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+                                                               ( mainCHECK_TIMER_PERIOD_MS ),          /* The timer period, in this case 3000ms (3s). */\r
+                                                               pdTRUE,                                                         /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+                                                               ( void * ) 0,                                           /* The ID is not used, so can be set to anything. */\r
+                                                               prvCheckTimerCallback                           /* The callback function that inspects the status of all the other tasks. */\r
+                                                         );\r
+\r
+       /* Sanity check that the timer was created. */\r
+       configASSERT( xCheckTimer );\r
+\r
+       /* Start the check timer. */\r
+       xTimerStart( xCheckTimer, 0UL );\r
+\r
+       /* Create a few standard demo tasks, just so there are tasks running to\r
+       view on the web server and via the command line command interpreter. */\r
+       vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
 \r
        /* Register two command line commands to show task stats and run time stats\r
        respectively. */\r
-       vCmdIntRegisterCommand( &xTaskStats );\r
-       vCmdIntRegisterCommand( &xRunTimeStats );\r
+       xCmdIntRegisterCommand( &xTaskStats );\r
+       xCmdIntRegisterCommand( &xRunTimeStats );\r
 \r
        /* Start the scheduler itself. */\r
        vTaskStartScheduler();\r
 \r
-    /* Should never get here unless there was not enough heap space to create \r
-       the idle and other system tasks. */\r
-    return 0;\r
+       /* This line should never be reached.  If it does execute then there was\r
+       insufficient FreeRTOS heap memory available for the idle and/or timer\r
+       tasks to be created. */\r
+       for( ;; )\r
+       {\r
+               Sleep( ulLongTime_ms );\r
+       }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvCheckTask( void *pvParameters )\r
+static void prvCheckTimerCallback( xTimerHandle xTimer )\r
 {\r
-portTickType xNextWakeTime;\r
-const portTickType xCycleFrequency = 1000 / portTICK_RATE_MS;\r
-\r
-       /* Just to remove compiler warning. */\r
-       ( void ) pvParameters;\r
-\r
-       /* Initialise xNextWakeTime - this only needs to be done once. */\r
-       xNextWakeTime = xTaskGetTickCount();\r
-\r
-       for( ;; )\r
+       /* The parameter is not used in this case. */\r
+       ( void ) xTimer;\r
+\r
+       /* Check the standard demo tasks are running without error.   Latch the\r
+       latest reported error in the pcStatusMessage character pointer.  The latched\r
+       string can be viewed using the embedded web server and the command line\r
+       interpreter.  This project is really to demonstrate the lwIP stack - so very\r
+       few tasks are created - and those that are created are created purely so\r
+       there is something to view. */\r
+       if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
        {\r
-               /* Place this task in the blocked state until it is time to run again. */\r
-               vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );\r
-\r
-               /* Check the standard demo tasks are running without error. */\r
-               if( xAreTimerDemoTasksStillRunning( xCycleFrequency ) != pdTRUE )\r
-               {\r
-                       pcStatusMessage = "Error: TimerDemo";\r
-               }\r
-           else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
-           {\r
-                       pcStatusMessage = "Error: IntMath";\r
-           }   \r
-               else if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
-               {                       \r
-                       pcStatusMessage = "Error: GenQueue";\r
-               }\r
-               else if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
-               {\r
-                       pcStatusMessage = "Error: QueuePeek";\r
-               }\r
-               else if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
-               {\r
-                       pcStatusMessage = "Error: BlockQueue";\r
-               }\r
-           else if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
-           {\r
-                       pcStatusMessage = "Error: SemTest";\r
-           }\r
-           else if( xArePollingQueuesStillRunning() != pdTRUE )\r
-           {\r
-                       pcStatusMessage = "Error: PollQueue";\r
-           }\r
-               else if( xAreMathsTaskStillRunning() != pdPASS )\r
-               {\r
-                       pcStatusMessage = "Error: Flop";\r
-               }\r
-           else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
-           {\r
-                       pcStatusMessage = "Error: RecMutex";\r
-               }\r
-               else if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )\r
-               {\r
-                       pcStatusMessage = "Error: CountSem";\r
-               }\r
-\r
-               /* This is the only task that uses stdout so its ok to call printf() \r
-               directly. */\r
-               printf( "%s - %d\r\n", pcStatusMessage, xTaskGetTickCount() );\r
+               pcStatusMessage = "Error: The GenQueue test reported an error.";\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -323,18 +255,6 @@ const unsigned long ulLongSleep = 1000UL;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vApplicationTickHook( void )\r
-{\r
-       #if configINCLUDE_STANDARD_DEMO_TASKS == 1\r
-       {\r
-               /* Call the periodic timer test, which tests the timer API functions that\r
-               can be called from an ISR. */\r
-               vTimerPeriodicISRTests();\r
-       }\r
-       #endif\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
 void vAssertCalled( void )\r
 {\r
 const unsigned long ulLongSleep = 1000UL;\r
@@ -398,6 +318,7 @@ unsigned long ulReturn;
 static const signed char *prvTaskStatsCommand( void )\r
 {\r
 static signed char *pcReturn = NULL;\r
+static char cTxBuffer[ 1024 ]; /*_RB_ Remove this. */\r
 \r
        /* This is the callback function that is executed when the command line\r
        command defined by the xTaskStats structure is entered.  This function\r
@@ -425,6 +346,8 @@ static signed char *pcReturn = NULL;
 static const signed char *prvRunTimeStatsCommand( void )\r
 {\r
 static signed char *pcReturn = NULL;\r
+static char cTxBuffer[ 1024 ]; /*_RB_ Remove this. */\r
+\r
 \r
        /* This is the callback function that is executed when the command line\r
        command defined by the xRunTimeStats structure is entered.  This function\r