aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-AT91SAM7X-LWIP-GCC
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-10-11 18:56:06 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-10-11 18:56:06 +0000
commit1b7bfa2fa713c75df4bbea37fc50b1d6d7b93839 (patch)
tree59433d0f70af4cf8a2ef65846028b3d28c146f15 /demos/ARM7-AT91SAM7X-LWIP-GCC
parentf1badd1b2946417f65230bc5d1608b837391125f (diff)
downloadChibiOS-1b7bfa2fa713c75df4bbea37fc50b1d6d7b93839.tar.gz
ChibiOS-1b7bfa2fa713c75df4bbea37fc50b1d6d7b93839.tar.bz2
ChibiOS-1b7bfa2fa713c75df4bbea37fc50b1d6d7b93839.zip
Fixed a bug in lwip_thread().
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1217 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARM7-AT91SAM7X-LWIP-GCC')
-rw-r--r--demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c12
-rw-r--r--demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h10
2 files changed, 14 insertions, 8 deletions
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c
index d89ab25ee..6741630cb 100644
--- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c
+++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c
@@ -92,12 +92,12 @@ static void low_level_init(struct netif *netif) {
netif->hwaddr_len = ETHARP_HWADDR_LEN;
/* set MAC hardware address */
- netif->hwaddr[0] = 0xC2;
+/* netif->hwaddr[0] = 0xC2;
netif->hwaddr[1] = 0xAF;
netif->hwaddr[2] = 0x51;
netif->hwaddr[3] = 0x03;
netif->hwaddr[4] = 0xCF;
- netif->hwaddr[5] = 0x46;
+ netif->hwaddr[5] = 0x46;*/
/* maximum transfer unit */
netif->mtu = 1500;
@@ -246,17 +246,23 @@ msg_t lwip_thread(void *p) {
for (i = 0; i < 6; i++)
thisif.hwaddr[i] = opts->macaddress[i];
- macSetAddress(&ETH1, thisif.hwaddr);
}
ip.addr = opts->address;
gateway.addr = opts->gateway;
netmask.addr = opts->netmask;
}
else {
+ thisif.hwaddr[0] = LWIP_ETHADDR_0;
+ thisif.hwaddr[1] = LWIP_ETHADDR_1;
+ thisif.hwaddr[2] = LWIP_ETHADDR_2;
+ thisif.hwaddr[3] = LWIP_ETHADDR_3;
+ thisif.hwaddr[4] = LWIP_ETHADDR_4;
+ thisif.hwaddr[5] = LWIP_ETHADDR_5;
LWIP_IPADDR(&ip);
LWIP_GATEWAY(&gateway);
LWIP_NETMASK(&netmask);
}
+ macSetAddress(&ETH1, thisif.hwaddr);
netif_add(&thisif, &ip, &netmask, &gateway, NULL, ethernetif_init, tcpip_input);
netif_set_default(&thisif);
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h
index 7e001ddd1..6fa4cbe7e 100644
--- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h
+++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h
@@ -68,27 +68,27 @@
#endif
/** @brief MAC Address byte 1. */
-#if !defined(LWIP_ETHADDR_0) || defined(__DOXYGEN__)
+#if !defined(LWIP_ETHADDR_1) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_1 0xAF
#endif
/** @brief MAC Address byte 2. */
-#if !defined(LWIP_ETHADDR_0) || defined(__DOXYGEN__)
+#if !defined(LWIP_ETHADDR_2) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_2 0x51
#endif
/** @brief MAC Address byte 3. */
-#if !defined(LWIP_ETHADDR_0) || defined(__DOXYGEN__)
+#if !defined(LWIP_ETHADDR_3) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_3 0x03
#endif
/** @brief MAC Address byte 4. */
-#if !defined(LWIP_ETHADDR_0) || defined(__DOXYGEN__)
+#if !defined(LWIP_ETHADDR_4) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_4 0xCF
#endif
/** @brief MAC Address byte 5. */
-#if !defined(LWIP_ETHADDR_0) || defined(__DOXYGEN__)
+#if !defined(LWIP_ETHADDR_5) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_5 0x46
#endif