#include "Lib/WebserverApp.h"
+ #include "Lib/DHCPApp.h"
/* Macros: */
- /** IP address that the webserver should use once connected to a RNDIS device. */
+ /** IP address that the webserver should use once connected to a RNDIS device (when DHCP is disabled). */
#define DEVICE_IP_ADDRESS (uint8_t[]){192, 168, 1, 10}
- /** Netmask that the webserver should once connected to a RNDIS device. */
+ /** Netmask that the webserver should once connected to a RNDIS device (when DHCP is disabled). */
#define DEVICE_NETMASK (uint8_t[]){255, 255, 255, 0}
- /** IP address of the default gateway the webserver should use when routing outside the local subnet. */
+ /** IP address of the default gateway the webserver should use when routing outside the local subnet
+ * (when DHCP is disabled).
+ */
#define DEVICE_GATEWAY (uint8_t[]){192, 168, 1, 1}
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
@@ -78,6 +80,9 @@
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_USB_BUSY LEDS_LED2
+
+ /* External Variables: */
+ extern struct uip_eth_addr MACAddress;
/* Function Prototypes: */
void SetupHardware(void);
diff --git a/Projects/Webserver/Webserver.txt b/Projects/Webserver/Webserver.txt
index 5c27954a9f..e1d298596d 100644
--- a/Projects/Webserver/Webserver.txt
+++ b/Projects/Webserver/Webserver.txt
@@ -63,19 +63,25 @@
* Description: |
*
*
+ * ENABLE_DHCP |
+ * Makefile CDEFS |
+ * When defined, enables the DHCP client for dynamic IP allocation of the network settings from a DHCP server. |
+ *
+ *
* DEVICE_IP_ADDRESS |
* Webserver.h |
- * IP address that the webserver should use when connected to a RNDIS device. |
+ * IP address that the webserver should use when connected to a RNDIS device (when ENABLE_DHCP is not defined). |
*
*
* DEVICE_NETMASK |
* Webserver.h |
- * Netmask that the webserver should use when connected to a RNDIS device. |
+ * Netmask that the webserver should use when connected to a RNDIS device (when ENABLE_DHCP is not defined). |
*
*
* DEVICE_GATEWAY |
* Webserver.h |
- * Default routing gateway that the webserver should use when connected to a RNDIS device. |
+ * Default routing gateway that the webserver should use when connected to a RNDIS device (when ENABLE_DHCP
+ * is not defined). |
*
*
*/
\ No newline at end of file
diff --git a/Projects/Webserver/makefile b/Projects/Webserver/makefile
index 27a7850aa1..4a1b85bddd 100644
--- a/Projects/Webserver/makefile
+++ b/Projects/Webserver/makefile
@@ -122,6 +122,7 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c \
+ Lib/DHCPApp.c \
Lib/WebserverApp.c \
$(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c \
$(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c \
@@ -188,6 +189,7 @@ CSTANDARD = -std=gnu99
# Place -D or -U options here for C sources
CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
+CDEFS += -DENABLE_DHCP
# Place -D or -U options here for ASM sources