Fixed SerialStream driver blocking while waiting for characters to be received instea...
[pub/USBasp.git] / Projects / Webserver / Lib / uIPManagement.c
index 1b94e8a..c7773c4 100644 (file)
@@ -30,7 +30,7 @@
 \r
 /** \file\r
  *\r
 \r
 /** \file\r
  *\r
- *  uIP Managament functions. This file contains the functions and globals needed to maintain the uIP\r
+ *  uIP Management functions. This file contains the functions and globals needed to maintain the uIP\r
  *  stack once an RNDIS device has been attached to the system.\r
  */\r
 \r
  *  stack once an RNDIS device has been attached to the system.\r
  */\r
 \r
@@ -52,7 +52,7 @@ void uIPManagement_Init(void)
 {\r
        /* uIP Timing Initialization */\r
        clock_init();\r
 {\r
        /* uIP Timing Initialization */\r
        clock_init();\r
-       timer_set(&ConnectionTimer, CLOCK_SECOND / 8);\r
+       timer_set(&ConnectionTimer, CLOCK_SECOND / 10);\r
        timer_set(&ARPTimer, CLOCK_SECOND * 10);        \r
 \r
        /* uIP Stack Initialization */\r
        timer_set(&ARPTimer, CLOCK_SECOND * 10);        \r
 \r
        /* uIP Stack Initialization */\r
@@ -87,7 +87,7 @@ void uIPManagement_ManageNetwork(void)
 {\r
        if ((USB_CurrentMode == USB_MODE_HOST) && (USB_HostState == HOST_STATE_Configured))\r
        {\r
 {\r
        if ((USB_CurrentMode == USB_MODE_HOST) && (USB_HostState == HOST_STATE_Configured))\r
        {\r
-               uIPManagement_ProcessIncommingPacket();\r
+               uIPManagement_ProcessIncomingPacket();\r
                uIPManagement_ManageConnections();\r
        }\r
 }\r
                uIPManagement_ManageConnections();\r
        }\r
 }\r
@@ -123,8 +123,8 @@ void uIPManagement_UDPCallback(void)
        }\r
 }\r
 \r
        }\r
 }\r
 \r
-/** Processes incomming packets to the server from the connected RNDIS device, creating responses as needed. */\r
-static void uIPManagement_ProcessIncommingPacket(void)\r
+/** Processes Incoming packets to the server from the connected RNDIS device, creating responses as needed. */\r
+static void uIPManagement_ProcessIncomingPacket(void)\r
 {\r
        /* If no packet received, exit processing routine */\r
        if (!(RNDIS_Host_IsPacketReceived(&Ethernet_RNDIS_Interface)))\r
 {\r
        /* If no packet received, exit processing routine */\r
        if (!(RNDIS_Host_IsPacketReceived(&Ethernet_RNDIS_Interface)))\r
@@ -132,7 +132,7 @@ static void uIPManagement_ProcessIncommingPacket(void)
          \r
        LEDs_SetAllLEDs(LEDMASK_USB_BUSY);\r
 \r
          \r
        LEDs_SetAllLEDs(LEDMASK_USB_BUSY);\r
 \r
-       /* Read the incomming packet straight into the UIP packet buffer */\r
+       /* Read the Incoming packet straight into the UIP packet buffer */\r
        RNDIS_Host_ReadPacket(&Ethernet_RNDIS_Interface, uip_buf, &uip_len);\r
 \r
        /* If the packet contains an Ethernet frame, process it */\r
        RNDIS_Host_ReadPacket(&Ethernet_RNDIS_Interface, uip_buf, &uip_len);\r
 \r
        /* If the packet contains an Ethernet frame, process it */\r
@@ -144,7 +144,7 @@ static void uIPManagement_ProcessIncommingPacket(void)
                                /* Filter packet by MAC destination */\r
                                uip_arp_ipin();\r
 \r
                                /* Filter packet by MAC destination */\r
                                uip_arp_ipin();\r
 \r
-                               /* Process incomming packet */\r
+                               /* Process Incoming packet */\r
                                uip_input();\r
 \r
                                /* If a response was generated, send it */\r
                                uip_input();\r
 \r
                                /* If a response was generated, send it */\r
@@ -175,7 +175,6 @@ static void uIPManagement_ProcessIncommingPacket(void)
 /** Manages the currently open network connections, including TCP and (if enabled) UDP. */\r
 static void uIPManagement_ManageConnections(void)\r
 {\r
 /** Manages the currently open network connections, including TCP and (if enabled) UDP. */\r
 static void uIPManagement_ManageConnections(void)\r
 {\r
-#if 0\r
        /* Poll TCP connections for more data to send back to the host */\r
        for (uint8_t i = 0; i < UIP_CONNS; i++)\r
        {\r
        /* Poll TCP connections for more data to send back to the host */\r
        for (uint8_t i = 0; i < UIP_CONNS; i++)\r
        {\r
@@ -190,7 +189,7 @@ static void uIPManagement_ManageConnections(void)
                        RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface, uip_buf, uip_len);\r
                }\r
        }\r
                        RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface, uip_buf, uip_len);\r
                }\r
        }\r
-#endif\r
+\r
        /* Manage open connections for timeouts */\r
        if (timer_expired(&ConnectionTimer))\r
        {\r
        /* Manage open connections for timeouts */\r
        if (timer_expired(&ConnectionTimer))\r
        {\r