/*\r
- FreeRTOS.org V5.1.0 - Copyright (C) 2003-2008 Richard Barry.\r
+ FreeRTOS.org V5.1.1 - Copyright (C) 2003-2008 Richard Barry.\r
\r
This file is part of the FreeRTOS.org distribution.\r
\r
port sections of the online documentation.\r
***************************************************************************\r
*/\r
+\r
+\r
+/* Task that controls the uIP TCP/IP stack. */\r
+\r
+\r
/* Standard includes. */\r
#include <string.h>\r
\r
#include "FEC.h"\r
#include "partest.h"\r
\r
-//struct timer {\r
-// clock_time_t start;\r
-// clock_time_t interval;\r
-//};\r
-\r
\r
/*-----------------------------------------------------------*/\r
\r
-/* How long to wait before attempting to connect the MAC again. */\r
-#define uipINIT_WAIT 100\r
-\r
/* Shortcut to the header within the Rx buffer. */\r
#define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ])\r
\r
-/* Standard constant. */\r
-#define uipTOTAL_FRAME_HEADER_SIZE 54\r
-\r
/*-----------------------------------------------------------*/\r
\r
/*\r
*/\r
void clock_init( void );\r
clock_time_t clock_time( void );\r
+extern void timer_set(struct timer *t, clock_time_t interval);\r
+extern int timer_expired(struct timer *t);\r
+extern void timer_reset(struct timer *t);\r
\r
/*-----------------------------------------------------------*/\r
\r
{\r
return xTaskGetTickCount();\r
}\r
-extern void timer_set(struct timer *t, clock_time_t interval);\r
-extern int timer_expired(struct timer *t);\r
-extern void timer_reset(struct timer *t);\r
-\r
-\r
-\r
+/*-----------------------------------------------------------*/\r
\r
void vuIP_Task( void *pvParameters )\r
{\r
portBASE_TYPE i;\r
uip_ipaddr_t xIPAddr;\r
struct timer periodic_timer, arp_timer;\r
-extern void ( vEMAC_ISR )( void );\r
\r
/* To prevent compiler warnings. */\r
( void ) pvParameters;\r
uip_init();\r
uip_ipaddr( xIPAddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );\r
uip_sethostaddr( xIPAddr );\r
+\r
+ /* Initialise the WEB server. */\r
httpd_init();\r
\r
- vInitFEC();\r
+ /* Initialise the Ethernet controller peripheral. */\r
+ vFECInit();\r
\r
for( ;; )\r
{\r
/* Is there received data ready to be processed? */\r
- uip_len = usGetFECRxData();\r
+ uip_len = usFECGetRxedData();\r
\r
if( uip_len > 0 )\r
{\r
if( uip_len > 0 )\r
{\r
uip_arp_out();\r
- vSendBufferToFEC();\r
+ vFECSendData();\r
}\r
else\r
{\r
- vDiscardRxData();\r
+ /* If we are not sending data then let the FEC driver know\r
+ the buffer is no longer required. */\r
+ vFECRxProcessingCompleted();\r
}\r
}\r
else if( xHeader->type == htons( UIP_ETHTYPE_ARP ) )\r
uip_len is set to a value > 0. */\r
if( uip_len > 0 )\r
{\r
- vSendBufferToFEC();\r
+ vFECSendData();\r
}\r
else\r
{\r
- vDiscardRxData();\r
+ /* If we are not sending data then let the FEC driver know\r
+ the buffer is no longer required. */\r
+ vFECRxProcessingCompleted();\r
}\r
}\r
else\r
{\r
- vDiscardRxData();\r
+ /* If we are not sending data then let the FEC driver know\r
+ the buffer is no longer required. */\r
+ vFECRxProcessingCompleted();\r
}\r
}\r
else\r
if( uip_len > 0 )\r
{\r
uip_arp_out();\r
- vSendBufferToFEC();\r
+ vFECSendData();\r
}\r
}\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vApplicationProcessFormInput( portCHAR *pcInputString )\r
-{\r
-char *c = pcInputString;\r
-\r
- /* Process the form input sent by the IO page of the served HTML. */\r
- while( ( *c != '?' ) && ( *c != 0x00 ) )\r
- {\r
- c++;\r
- }\r
-\r
- if( *c == '?' )\r
- {\r
- c++;\r
- if( strcmp( c, "LED0=1" ) == 0 )\r
- {\r
- vParTestSetLED( 3, 1 );\r
- }\r
- else\r
- {\r
- vParTestSetLED( 3, 0 );\r
- }\r
- }\r
-}\r
-\r
\r
\r