Webserver project now uses the board LEDs to indicate the current IP configuration...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 9 Mar 2010 05:15:08 +0000 (05:15 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 9 Mar 2010 05:15:08 +0000 (05:15 +0000)
Don't double-read data from the attached disk in the incomplete StandaloneProgrammer project when in host mode.

LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/LUFAPoweredProjects.txt
Projects/Incomplete/StandaloneProgrammer/Lib/PetiteFATFs/diskio.c
Projects/Webserver/Lib/DHCPClientApp.c
Projects/Webserver/Lib/HTTPServerApp.c
Projects/Webserver/Lib/uIPManagement.c
Projects/Webserver/Lib/uIPManagement.h
Projects/Webserver/Webserver.h
makefile

index 0ef0fbc..cdffd3c 100644 (file)
@@ -16,6 +16,7 @@
   *    for PDI and TPI programming\r
   *  - Increased the speed of both software and hardware TPI/PDI programming modes of the AVRISP project\r
   *  - Added a timeout value to the TWI_StartTransmission() function, within which the addressed device must respond\r
   *    for PDI and TPI programming\r
   *  - Increased the speed of both software and hardware TPI/PDI programming modes of the AVRISP project\r
   *  - Added a timeout value to the TWI_StartTransmission() function, within which the addressed device must respond\r
+  *  - Webserver project now uses the board LEDs to indicate the current IP configuration state\r
   *\r
   *  <b>Fixed:</b>\r
   *  - Fixed software PDI/TPI programming mode in the AVRISP project not correctly toggling just the clock pin\r
   *\r
   *  <b>Fixed:</b>\r
   *  - Fixed software PDI/TPI programming mode in the AVRISP project not correctly toggling just the clock pin\r
index 9fd0c5f..2d6feac 100644 (file)
@@ -24,6 +24,7 @@
  *  - Micropendous, an open design/source set of AVR USB development boards: http://micropendous.org/\r
  *  - Nanduino, a do-it-yourself AT90USB162 board: http://www.makestuff.eu/wordpress/?page_id=569\r
  *  - Teensy and Teensy++, two other AVR USB development boards: http://www.pjrc.com/teensy/index.html\r
  *  - Micropendous, an open design/source set of AVR USB development boards: http://micropendous.org/\r
  *  - Nanduino, a do-it-yourself AT90USB162 board: http://www.makestuff.eu/wordpress/?page_id=569\r
  *  - Teensy and Teensy++, two other AVR USB development boards: http://www.pjrc.com/teensy/index.html\r
+ *  - U2DIL/U4DIL, a set of DIP layout USB AVR boards: http://www.reworld.eu/re/en/products/u2dil/\r
  *  - USB10 AKA "The Ferret", a AT90USB162 development board: http://www.soc-machines.com\r
  *  - USBFoo, an AT90USB162 based development board: http://shop.kernelconcepts.de/product_info.php?products_id=102\r
  * \r
  *  - USB10 AKA "The Ferret", a AT90USB162 development board: http://www.soc-machines.com\r
  *  - USBFoo, an AT90USB162 based development board: http://shop.kernelconcepts.de/product_info.php?products_id=102\r
  * \r
index bcf1674..c0393dd 100644 (file)
@@ -41,8 +41,6 @@ DRESULT disk_readp (
                  ErrorCode = RES_NOTRDY;\r
                else if (MS_Host_ReadDeviceBlocks(&DiskHost_MS_Interface, 0, sector, 1, 512, BlockTemp))\r
                  ErrorCode = RES_ERROR;\r
                  ErrorCode = RES_NOTRDY;\r
                else if (MS_Host_ReadDeviceBlocks(&DiskHost_MS_Interface, 0, sector, 1, 512, BlockTemp))\r
                  ErrorCode = RES_ERROR;\r
-\r
-               MS_Host_ReadDeviceBlocks(&DiskHost_MS_Interface, 0, sector, 1, 512, BlockTemp);\r
                #endif\r
        }\r
        else\r
                #endif\r
        }\r
        else\r
index cf51273..01cbb7e 100644 (file)
@@ -156,7 +156,10 @@ void DHCPClientApp_Callback(void)
                                uip_setnetmask((uip_ipaddr_t*)&AppState->DHCPClient.DHCPOffer_Data.Netmask);\r
                                uip_setdraddr((uip_ipaddr_t*)&AppState->DHCPClient.DHCPOffer_Data.GatewayIP);\r
                        \r
                                uip_setnetmask((uip_ipaddr_t*)&AppState->DHCPClient.DHCPOffer_Data.Netmask);\r
                                uip_setdraddr((uip_ipaddr_t*)&AppState->DHCPClient.DHCPOffer_Data.GatewayIP);\r
                        \r
-                               AppState->DHCPClient.CurrentState = DHCP_STATE_AddressLeased;\r
+                               /* Indicate to the user that we now have a valid IP configuration */\r
+                               HaveIPConfiguration = true;\r
+\r
+                               AppState->DHCPClient.CurrentState = DHCP_STATE_AddressLeased;                           \r
                        }\r
                        \r
                        break;\r
                        }\r
                        \r
                        break;\r
index 4e00952..1a1d2c4 100644 (file)
@@ -77,7 +77,7 @@ const MIME_Type_t MIMETypes[] =
                {.Extension = "pdf", .MIMEType = "application/pdf"},\r
        };\r
 \r
                {.Extension = "pdf", .MIMEType = "application/pdf"},\r
        };\r
 \r
-/** FAT Fs structure to hold the internal state of the FAT driver for the dataflash contents. */\r
+/** FATFs structure to hold the internal state of the FAT driver for the dataflash contents. */\r
 FATFS DiskFATState;\r
 \r
 \r
 FATFS DiskFATState;\r
 \r
 \r
index bd7804e..3a9db34 100644 (file)
@@ -46,6 +46,7 @@ struct timer ARPTimer;
 /** MAC address of the RNDIS device, when enumerated */\r
 struct uip_eth_addr MACAddress;\r
 \r
 /** MAC address of the RNDIS device, when enumerated */\r
 struct uip_eth_addr MACAddress;\r
 \r
+bool HaveIPConfiguration;\r
 \r
 /** Configures the uIP stack ready for network traffic. */\r
 void uIPManagement_Init(void)\r
 \r
 /** Configures the uIP stack ready for network traffic. */\r
 void uIPManagement_Init(void)\r
@@ -62,8 +63,10 @@ void uIPManagement_Init(void)
 \r
        /* DHCP/Server IP Settings Initialization */\r
        #if defined(ENABLE_DHCP_CLIENT)\r
 \r
        /* DHCP/Server IP Settings Initialization */\r
        #if defined(ENABLE_DHCP_CLIENT)\r
+       HaveIPConfiguration = false;\r
        DHCPClientApp_Init();\r
        #else\r
        DHCPClientApp_Init();\r
        #else\r
+       HaveIPConfiguration = true;\r
        uip_ipaddr_t IPAddress, Netmask, GatewayIPAddress;\r
        uip_ipaddr(&IPAddress,        DEVICE_IP_ADDRESS[0], DEVICE_IP_ADDRESS[1], DEVICE_IP_ADDRESS[2], DEVICE_IP_ADDRESS[3]);\r
        uip_ipaddr(&Netmask,          DEVICE_NETMASK[0],    DEVICE_NETMASK[1],    DEVICE_NETMASK[2],    DEVICE_NETMASK[3]);\r
        uip_ipaddr_t IPAddress, Netmask, GatewayIPAddress;\r
        uip_ipaddr(&IPAddress,        DEVICE_IP_ADDRESS[0], DEVICE_IP_ADDRESS[1], DEVICE_IP_ADDRESS[2], DEVICE_IP_ADDRESS[3]);\r
        uip_ipaddr(&Netmask,          DEVICE_NETMASK[0],    DEVICE_NETMASK[1],    DEVICE_NETMASK[2],    DEVICE_NETMASK[3]);\r
@@ -169,7 +172,7 @@ static void uIPManagement_ProcessIncomingPacket(void)
                }\r
        }\r
 \r
                }\r
        }\r
 \r
-       LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
+       LEDs_SetAllLEDs(LEDMASK_USB_READY | ((HaveIPConfiguration) ? LEDMASK_UIP_READY : LEDMASK_UIP_READY_NOCONFIG));\r
 }\r
 \r
 /** Manages the currently open network connections, including TCP and (if enabled) UDP. */\r
 }\r
 \r
 /** Manages the currently open network connections, including TCP and (if enabled) UDP. */\r
index 90b47ed..ed02374 100644 (file)
@@ -63,6 +63,8 @@
        /* External Variables: */\r
                extern struct uip_eth_addr MACAddress;\r
                \r
        /* External Variables: */\r
                extern struct uip_eth_addr MACAddress;\r
                \r
+               extern bool HaveIPConfiguration;\r
+               \r
        /* Function Prototypes: */\r
                void uIPManagement_Init(void);\r
                void uIPManagement_ManageNetwork(void);\r
        /* Function Prototypes: */\r
                void uIPManagement_Init(void);\r
                void uIPManagement_ManageNetwork(void);\r
index a9621e3..f1351d8 100644 (file)
                \r
        /* Macros: */\r
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */\r
                \r
        /* Macros: */\r
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */\r
-               #define LEDMASK_USB_NOTREADY      LEDS_LED1\r
+               #define LEDMASK_USB_NOTREADY          LEDS_LED1\r
 \r
                /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */\r
 \r
                /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */\r
-               #define LEDMASK_USB_ENUMERATING  (LEDS_LED2 | LEDS_LED3)\r
+               #define LEDMASK_USB_ENUMERATING      (LEDS_LED1 | LEDS_LED2)\r
 \r
                /** LED mask for the library LED driver, to indicate that the USB interface is ready. */\r
 \r
                /** LED mask for the library LED driver, to indicate that the USB interface is ready. */\r
-               #define LEDMASK_USB_READY        (LEDS_LED2 | LEDS_LED4)\r
+               #define LEDMASK_USB_READY             LEDS_LED2\r
 \r
                /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */\r
 \r
                /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */\r
-               #define LEDMASK_USB_ERROR        (LEDS_LED1 | LEDS_LED3)\r
+               #define LEDMASK_USB_ERROR            (LEDS_LED1 | LEDS_LED3)\r
                \r
                /** LED mask for the library LED driver, to indicate that the USB interface is busy. */\r
                \r
                /** LED mask for the library LED driver, to indicate that the USB interface is busy. */\r
-               #define LEDMASK_USB_BUSY          LEDS_LED2\r
+               #define LEDMASK_USB_BUSY             (LEDS_LED1 | LEDS_LED3 | LEDS_LED4)\r
+\r
+               /** LED mask for the uIP stack idling with no IP configuration */\r
+               #define LEDMASK_UIP_READY_NOCONFIG    LEDS_LED3\r
+\r
+               /** LED mask for the uIP stack idling with a valid IP configuration */\r
+               #define LEDMASK_UIP_READY_CONFIG      LEDS_LED4\r
 \r
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
index 2c7aeee..421c077 100644 (file)
--- a/makefile
+++ b/makefile
 # "make doxygen" to document everything with DoxyGen (if installed) and\r
 # "make clean_doxygen" to remove generated Doxygen documentation from everything.\r
 \r
 # "make doxygen" to document everything with DoxyGen (if installed) and\r
 # "make clean_doxygen" to remove generated Doxygen documentation from everything.\r
 \r
-# It is suggested that for the master build, the --quiet switch is passed to make,\r
-# to remove all the commands from the output. This gives a much easier to read\r
-# report of the entire build process.\r
-\r
 all:\r
 \r
 %:\r
        @echo Executing \"make $@\" on all LUFA library elements.\r
        @echo\r
 all:\r
 \r
 %:\r
        @echo Executing \"make $@\" on all LUFA library elements.\r
        @echo\r
-       make -C LUFA/ $@\r
-       make -C Demos/ $@\r
-       make -C Projects/ $@\r
-       make -C Bootloaders/ $@\r
+       make -C LUFA/ $@ -s\r
+       make -C Demos/ $@ -s\r
+       make -C Projects/ $@ -s\r
+       make -C Bootloaders/ $@ -s\r
        @echo\r
        @echo LUFA \"make $@\" operation complete.\r
        @echo\r
        @echo LUFA \"make $@\" operation complete.\r