mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 12:51:24 +01:00
Adanrg ethernet shield fixes (#107)
* Ethernet Shield can be configured with static IP * Use MAC address in config.h, if configured. * Fix library name typos * Update EthernetInterface.h Remove MAC address define here and remind people with a compile time error that it must be defined in the config.h Co-authored-by: Fred <fndecker@gmail.com>
This commit is contained in:
parent
7963b02839
commit
d70f76e80e
@ -50,11 +50,15 @@ EthernetInterface::EthernetInterface()
|
||||
DIAG(F("\n+++++ Ethernet Setup "));
|
||||
connected=false;
|
||||
|
||||
#ifdef IP_ADDRESS
|
||||
Ethernet.begin(mac, IP_ADDRESS);
|
||||
#else
|
||||
if (Ethernet.begin(mac) == 0)
|
||||
{
|
||||
DIAG(F("begin FAILED\n"));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
DIAG(F("begin OK."));
|
||||
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
|
||||
DIAG(F("shield not found\n"));
|
||||
|
@ -30,24 +30,14 @@
|
||||
#include <Ethernet.h>
|
||||
#include "RingStream.h"
|
||||
|
||||
/* some generated mac addresses as EthernetShields don't have one by default in HW.
|
||||
* Sometimes they come on a sticker on the EthernetShield then use this address otherwise
|
||||
* just choose one from below or generate one yourself. Only condition is that there is no
|
||||
* other device on your network with the same Mac address.
|
||||
*
|
||||
* 52:b8:8a:8e:ce:21
|
||||
* e3:e9:73:e1:db:0d
|
||||
* 54:2b:13:52:ac:0c
|
||||
* c2:d8:d4:7d:7c:cb
|
||||
* 86:cf:fa:9f:07:79
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Network Configuration
|
||||
*
|
||||
*/
|
||||
#define MAC_ADDRESS { 0x52, 0xB8, 0x8A, 0x8E, 0xCE, 0x21 } // MAC address of your networking card found on the sticker on your card or take one from above
|
||||
// this one is not used elsewhere and corresponds to your network layout
|
||||
#ifndef MAC_ADDRESS
|
||||
#error define MAC_ADDRESS in config.h
|
||||
#endif
|
||||
|
||||
#define LISTEN_PORT 2560 // default listen port for the server
|
||||
#define MAX_ETH_BUFFER 512
|
||||
#define OUTBOUND_RING_SIZE 2048
|
||||
|
Loading…
Reference in New Issue
Block a user