From 3b6776215f99e6fbe300a51e43d647e21fc02dba Mon Sep 17 00:00:00 2001 From: Nuno Silva Date: Sun, 22 Nov 2020 01:08:45 +0000 Subject: [PATCH] update examples to keep MAC in PROGMEM instead of RAM fixes #397 (ntpClient example) --- examples/JeeUdp/JeeUdp.ino | 4 ++-- examples/SSDP/SSDP.ino | 4 ++-- examples/backSoon/backSoon.ino | 4 ++-- examples/etherNode/etherNode.ino | 4 ++-- examples/getDHCPandDNS/getDHCPandDNS.ino | 4 ++-- examples/getStaticIP/getStaticIP.ino | 4 ++-- examples/getViaDNS/getViaDNS.ino | 4 ++-- examples/multipacket/multipacket.ino | 4 ++-- examples/multipacketSD/multipacketSD.ino | 4 ++-- examples/nanether/nanether.ino | 4 ++-- examples/noipClient/noipClient.ino | 4 ++-- examples/notifyMyAndroid/notifyMyAndroid.ino | 4 ++-- examples/ntpClient/ntpClient.ino | 2 +- examples/persistence/persistence.ino | 4 ++-- examples/pings/pings.ino | 4 ++-- examples/rbbb_server/rbbb_server.ino | 4 ++-- examples/stashTest/stashTest.ino | 4 ++-- examples/testDHCP/testDHCP.ino | 4 ++-- examples/testDHCPOptions/testDHCPOptions.ino | 4 ++-- examples/thingspeak/thingspeak.ino | 4 ++-- examples/twitter/twitter.ino | 4 ++-- examples/udpClientSendOnly/udpClientSendOnly.ino | 4 ++-- examples/udpListener/udpListener.ino | 4 ++-- examples/webClient/webClient.ino | 4 ++-- examples/xively/xively.ino | 4 ++-- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/examples/JeeUdp/JeeUdp.ino b/examples/JeeUdp/JeeUdp.ino index ad177fcc..21dcda80 100644 --- a/examples/JeeUdp/JeeUdp.ino +++ b/examples/JeeUdp/JeeUdp.ino @@ -25,7 +25,7 @@ struct Config { } config; // ethernet interface mac address - must be unique on your network -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; // buffer for an outgoing data packet static byte outBuf[RF12_MAXDATA], outDest; @@ -261,7 +261,7 @@ void setup (){ loadConfig(); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println( "Failed to access Ethernet controller"); if (!ether.dhcpSetup()) Serial.println("DHCP failed"); diff --git a/examples/SSDP/SSDP.ino b/examples/SSDP/SSDP.ino index 494cd1ec..7405ff41 100644 --- a/examples/SSDP/SSDP.ino +++ b/examples/SSDP/SSDP.ino @@ -10,7 +10,7 @@ const char SSDP_NOTIFY[] PROGMEM = "NOTIFY * HTTP/1.1\r\nHOST: 239.255.255.250:1 static byte myip[] = { 192,168,0,67 }; static byte gwip[] = { 192,168,0,250 }; static byte ssdp[] = { 239,255,255,250 }; -static byte mymac[] = { 0x74,0x99,0x69,0x2D,0x30,0x40 }; // if you change it you must update SSDP_RESPONSE and XML_DESCRIP +const static byte mymac[] PROGMEM = { 0x74,0x99,0x69,0x2D,0x30,0x40 }; // if you change it you must update SSDP_RESPONSE and XML_DESCRIP byte Ethernet::buffer[750]; // tcp ip send and receive buffer unsigned long timer=9999; const char pageA[] PROGMEM = @@ -99,7 +99,7 @@ void addip(int udppos) { // add current ip to the request and send it void setup(){ // Change 'SS' to your Slave Select pin, if you arn't using the default pin - ether.begin(sizeof Ethernet::buffer, mymac, SS); + ether.begin(sizeof Ethernet::buffer, mymac, SS, false); ether.staticSetup(myip, gwip); ENC28J60::disableMulticast(); //disable multicast filter means enable multicast reception Serial.begin(115200); diff --git a/examples/backSoon/backSoon.ino b/examples/backSoon/backSoon.ino index c0e94933..0ba6f277 100644 --- a/examples/backSoon/backSoon.ino +++ b/examples/backSoon/backSoon.ino @@ -15,7 +15,7 @@ static byte gwip[] = { 192,168,1,1 }; #endif // ethernet mac address - must be unique on your network -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; byte Ethernet::buffer[500]; // tcp/ip send and receive buffer @@ -43,7 +43,7 @@ void setup(){ Serial.println("\n[backSoon]"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println( "Failed to access Ethernet controller"); #if STATIC ether.staticSetup(myip, gwip); diff --git a/examples/etherNode/etherNode.ino b/examples/etherNode/etherNode.ino index 639ea958..ec6f35d9 100644 --- a/examples/etherNode/etherNode.ino +++ b/examples/etherNode/etherNode.ino @@ -28,7 +28,7 @@ struct Config { } config; // ethernet interface mac address - must be unique on your network -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; // buffer for an outgoing data packet static byte outBuf[RF12_MAXDATA], outDest; @@ -217,7 +217,7 @@ void setup(){ loadConfig(); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println( "Failed to access Ethernet controller"); if (!ether.dhcpSetup()) Serial.println("DHCP failed"); diff --git a/examples/getDHCPandDNS/getDHCPandDNS.ino b/examples/getDHCPandDNS/getDHCPandDNS.ino index 8c118184..8dcb4efb 100644 --- a/examples/getDHCPandDNS/getDHCPandDNS.ino +++ b/examples/getDHCPandDNS/getDHCPandDNS.ino @@ -8,7 +8,7 @@ #define REQUEST_RATE 5000 // milliseconds // ethernet interface mac address -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; // remote website name const char website[] PROGMEM = "google.com"; @@ -28,7 +28,7 @@ void setup () { Serial.println("\n[getDHCPandDNS]"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println( "Failed to access Ethernet controller"); if (!ether.dhcpSetup()) diff --git a/examples/getStaticIP/getStaticIP.ino b/examples/getStaticIP/getStaticIP.ino index 89258e1a..1ae8f734 100644 --- a/examples/getStaticIP/getStaticIP.ino +++ b/examples/getStaticIP/getStaticIP.ino @@ -8,7 +8,7 @@ #define REQUEST_RATE 5000 // milliseconds // ethernet interface mac address -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; // ethernet interface ip address static byte myip[] = { 192,168,1,203 }; // ethernet interface ip netmask @@ -36,7 +36,7 @@ void setup () { Serial.println("\n[getStaticIP]"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println( "Failed to access Ethernet controller"); ether.staticSetup(myip, gwip, NULL, mask); diff --git a/examples/getViaDNS/getViaDNS.ino b/examples/getViaDNS/getViaDNS.ino index 2a28489e..586f0cc5 100644 --- a/examples/getViaDNS/getViaDNS.ino +++ b/examples/getViaDNS/getViaDNS.ino @@ -8,7 +8,7 @@ #define REQUEST_RATE 5000 // milliseconds // ethernet interface mac address -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; // ethernet interface ip address static byte myip[] = { 192,168,1,203 }; // ethernet interface ip netmask @@ -34,7 +34,7 @@ void setup () { Serial.println("\n[getViaDNS]"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println( "Failed to access Ethernet controller"); ether.staticSetup(myip, gwip, NULL, mask); diff --git a/examples/multipacket/multipacket.ino b/examples/multipacket/multipacket.ino index 3f09a14a..13dfd75e 100644 --- a/examples/multipacket/multipacket.ino +++ b/examples/multipacket/multipacket.ino @@ -3,7 +3,7 @@ #define TCP_FLAGS_ACK_V 0x10 //as declared in net.h static byte myip[] = { 192,168,0,66 }; static byte gwip[] = { 192,168,0,250 }; -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x39 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x39 }; byte Ethernet::buffer[900]; // tcp ip send and receive buffer const char pageA[] PROGMEM = "HTTP/1.0 200 OK\r\n" @@ -48,7 +48,7 @@ const char pageE[] PROGMEM = void setup(){ // Change 'SS' to your Slave Select pin, if you arn't using the default pin - ether.begin(sizeof Ethernet::buffer, mymac , SS); + ether.begin(sizeof Ethernet::buffer, mymac , SS, false); ether.staticSetup(myip, gwip); } diff --git a/examples/multipacketSD/multipacketSD.ino b/examples/multipacketSD/multipacketSD.ino index 78134fc1..e674a05b 100644 --- a/examples/multipacketSD/multipacketSD.ino +++ b/examples/multipacketSD/multipacketSD.ino @@ -16,7 +16,7 @@ #define TCP_FLAGS_ACK_V 16 //as declared in net.h static byte myip[] = { 192,168,0,66 }; static byte gwip[] = { 192,168,0,250 }; -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x39 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x39 }; byte Ethernet::buffer[700]; // tcp/ip send and receive buffer unsigned long cur; unsigned long pos; @@ -103,7 +103,7 @@ void setup() if (res==NO_ERROR) Serial.println("SD started"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - ether.begin(sizeof Ethernet::buffer, mymac , SS); + ether.begin(sizeof Ethernet::buffer, mymac , SS, false); ether.staticSetup(myip, gwip); Serial.println("ETH started"); } diff --git a/examples/nanether/nanether.ino b/examples/nanether/nanether.ino index 0133db39..6c3ef2f0 100644 --- a/examples/nanether/nanether.ino +++ b/examples/nanether/nanether.ino @@ -6,7 +6,7 @@ #define BUF_SIZE 512 -byte mac[] = { 0x00, 0x04, 0xA3, 0x21, 0xCA, 0x38 }; // Nanode MAC address. +const byte mac[] PROGMEM = { 0x00, 0x04, 0xA3, 0x21, 0xCA, 0x38 }; // Nanode MAC address. uint8_t ip[] = { 192, 168, 1, 8 }; // The fallback board address. uint8_t dns[] = { 192, 168, 1, 20 }; // The DNS server address. @@ -24,7 +24,7 @@ void setup(void) Serial.println("Initialising the Ethernet controller"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mac, SS) == 0) { + if (ether.begin(sizeof Ethernet::buffer, mac, SS, false) == 0) { Serial.println( "Ethernet controller NOT initialised"); while (true) /* MT */ ; diff --git a/examples/noipClient/noipClient.ino b/examples/noipClient/noipClient.ino index 49a03922..fe1ab687 100644 --- a/examples/noipClient/noipClient.ino +++ b/examples/noipClient/noipClient.ino @@ -27,7 +27,7 @@ #define MAX_ATTEMPTS 3 // MAC Address of Ethernet Shield -static byte mymac[] = {0xDD,0xDD,0xDD,0x00,0x00,0x01}; +const static byte mymac[] PROGMEM = {0xDD,0xDD,0xDD,0x00,0x00,0x01}; // Insert your hostname and authentication string const char noIP_host[] PROGMEM = "myhost.no-ip.info"; @@ -213,7 +213,7 @@ void setup () { Serial.println(); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (!ether.begin(sizeof Ethernet::buffer, mymac, SS)) + if (!ether.begin(sizeof Ethernet::buffer, mymac, SS, false)) Serial.println(F( "Failed to access Ethernet controller")); else Serial.println(F("Ethernet controller initialized")); diff --git a/examples/notifyMyAndroid/notifyMyAndroid.ino b/examples/notifyMyAndroid/notifyMyAndroid.ino index 26732899..08f48541 100644 --- a/examples/notifyMyAndroid/notifyMyAndroid.ino +++ b/examples/notifyMyAndroid/notifyMyAndroid.ino @@ -12,7 +12,7 @@ const char apihost[] PROGMEM = "www.notifymyandroid.com"; -static byte mymac[] = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 }; +const static byte mymac[] PROGMEM = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 }; byte Ethernet::buffer[900]; Stash stash; @@ -59,7 +59,7 @@ void setup () { Serial.println("\nStarting Notify My Android Example"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/ntpClient/ntpClient.ino b/examples/ntpClient/ntpClient.ino index 90a76c79..9bb75967 100644 --- a/examples/ntpClient/ntpClient.ino +++ b/examples/ntpClient/ntpClient.ino @@ -75,7 +75,7 @@ void setup() { Serial.println(F("\n[EtherCard NTP Client]")); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, myMac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, myMac, SS, false) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/persistence/persistence.ino b/examples/persistence/persistence.ino index 071549f9..3c674aaf 100644 --- a/examples/persistence/persistence.ino +++ b/examples/persistence/persistence.ino @@ -5,7 +5,7 @@ #include // ethernet interface mac address, must be unique on the LAN -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; // the buffersize must be relatively large for DHCP to work; when // using static setup a buffer size of 100 is sufficient; @@ -46,7 +46,7 @@ void setup () { Serial.println(F("\n[Persistence+readPacketSlice]")); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/pings/pings.ino b/examples/pings/pings.ino index 42469752..1292348c 100644 --- a/examples/pings/pings.ino +++ b/examples/pings/pings.ino @@ -6,7 +6,7 @@ #include // ethernet interface mac address, must be unique on the LAN -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; byte Ethernet::buffer[700]; static uint32_t timer; @@ -21,7 +21,7 @@ void setup () { Serial.println("\n[pings]"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/rbbb_server/rbbb_server.ino b/examples/rbbb_server/rbbb_server.ino index fc0e4203..22e49c34 100644 --- a/examples/rbbb_server/rbbb_server.ino +++ b/examples/rbbb_server/rbbb_server.ino @@ -6,7 +6,7 @@ #include // ethernet interface mac address, must be unique on the LAN -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; static byte myip[] = { 192,168,1,203 }; byte Ethernet::buffer[500]; @@ -34,7 +34,7 @@ void setup () { Serial.begin(57600); Serial.println(F("\n[RBBB Server]")); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println(F("Failed to access Ethernet controller")); ether.staticSetup(myip); } diff --git a/examples/stashTest/stashTest.ino b/examples/stashTest/stashTest.ino index 040202a5..2392836a 100644 --- a/examples/stashTest/stashTest.ino +++ b/examples/stashTest/stashTest.ino @@ -7,7 +7,7 @@ #include // ethernet interface mac address, must be unique on the LAN -byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; byte Ethernet::buffer[700]; @@ -50,7 +50,7 @@ void setup () { Serial.println("\n[stashTest]"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - ether.begin(sizeof Ethernet::buffer, mymac, SS); + ether.begin(sizeof Ethernet::buffer, mymac, SS, false); #if 1 Stash buf; diff --git a/examples/testDHCP/testDHCP.ino b/examples/testDHCP/testDHCP.ino index ff54f463..833992b0 100644 --- a/examples/testDHCP/testDHCP.ino +++ b/examples/testDHCP/testDHCP.ino @@ -7,7 +7,7 @@ #include -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; byte Ethernet::buffer[700]; @@ -24,7 +24,7 @@ void setup () { Serial.println(); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println(F("Failed to access Ethernet controller")); Serial.println(F("Setting up DHCP")); diff --git a/examples/testDHCPOptions/testDHCPOptions.ino b/examples/testDHCPOptions/testDHCPOptions.ino index e761176e..f1e02e53 100644 --- a/examples/testDHCPOptions/testDHCPOptions.ino +++ b/examples/testDHCPOptions/testDHCPOptions.ino @@ -5,7 +5,7 @@ #include -static byte mymac[] = { 0x6e, 0x1b, 0xd0, 0x2e, 0xdd, 0xa5 }; +const static byte mymac[] PROGMEM = { 0x6e, 0x1b, 0xd0, 0x2e, 0xdd, 0xa5 }; byte Ethernet::buffer[700]; @@ -28,7 +28,7 @@ void setup () { } Serial.println(); - if (ether.begin(sizeof Ethernet::buffer, mymac, 8) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, 8, false) == 0) Serial.println(F("Failed to access Ethernet controller")); // Add callback for the NTP option (DHCP Option number 42) diff --git a/examples/thingspeak/thingspeak.ino b/examples/thingspeak/thingspeak.ino index 25d67ee9..6621cc70 100644 --- a/examples/thingspeak/thingspeak.ino +++ b/examples/thingspeak/thingspeak.ino @@ -19,7 +19,7 @@ #define APIKEY "beef1337beef1337" // put your key here // ethernet interface mac address, must be unique on the LAN -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; const char website[] PROGMEM = "api.thingspeak.com"; byte Ethernet::buffer[700]; uint32_t timer; @@ -41,7 +41,7 @@ void initialize_ethernet(void){ //delay(500); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0){ + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0){ Serial.println( "Failed to access Ethernet controller"); continue; } diff --git a/examples/twitter/twitter.ino b/examples/twitter/twitter.ino index 3b943aaf..985fcce5 100644 --- a/examples/twitter/twitter.ino +++ b/examples/twitter/twitter.ino @@ -20,7 +20,7 @@ #define TOKEN "Insert-your-token-here" // ethernet interface mac address, must be unique on the LAN -byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; const char website[] PROGMEM = "arduino-tweet.appspot.com"; @@ -60,7 +60,7 @@ void setup () { Serial.println("\n[Twitter Client]"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/udpClientSendOnly/udpClientSendOnly.ino b/examples/udpClientSendOnly/udpClientSendOnly.ino index feda2d90..7f391c2b 100644 --- a/examples/udpClientSendOnly/udpClientSendOnly.ino +++ b/examples/udpClientSendOnly/udpClientSendOnly.ino @@ -1,6 +1,6 @@ #include -static byte mymac[] = { 0x1A,0x2B,0x3C,0x4D,0x5E,0x6F }; +const static byte mymac[] PROGMEM = { 0x1A,0x2B,0x3C,0x4D,0x5E,0x6F }; byte Ethernet::buffer[700]; static uint32_t timer; @@ -13,7 +13,7 @@ void setup () { Serial.begin(9600); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println( "Failed to access Ethernet controller"); if (!ether.dhcpSetup()) Serial.println("DHCP failed"); diff --git a/examples/udpListener/udpListener.ino b/examples/udpListener/udpListener.ino index d814721f..670ea238 100644 --- a/examples/udpListener/udpListener.ino +++ b/examples/udpListener/udpListener.ino @@ -19,7 +19,7 @@ static byte gwip[] = { 192,168,0,1 }; #endif // Ethernet MAC address - must be unique on your network -static byte mymac[] = { 0x70,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x70,0x69,0x69,0x2D,0x30,0x31 }; byte Ethernet::buffer[500]; // TCP/IP send and receive buffer @@ -44,7 +44,7 @@ void setup(){ Serial.println(F("\n[backSoon]")); // Change 'SS' to your Slave Select pin if you aren't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println(F("Failed to access Ethernet controller")); #if STATIC ether.staticSetup(myip, gwip); diff --git a/examples/webClient/webClient.ino b/examples/webClient/webClient.ino index bf661992..b42d769d 100644 --- a/examples/webClient/webClient.ino +++ b/examples/webClient/webClient.ino @@ -6,7 +6,7 @@ #include // ethernet interface mac address, must be unique on the LAN -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; byte Ethernet::buffer[700]; static uint32_t timer; @@ -26,7 +26,7 @@ void setup () { Serial.println(F("\n[webClient]")); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/xively/xively.ino b/examples/xively/xively.ino index 23012100..fc1c4ad9 100644 --- a/examples/xively/xively.ino +++ b/examples/xively/xively.ino @@ -13,7 +13,7 @@ #define APIKEY "xxx" // ethernet interface mac address, must be unique on the LAN -static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; +const static byte mymac[] PROGMEM = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; const char website[] PROGMEM = "api.xively.com"; @@ -36,7 +36,7 @@ void initialize_ethernet(void){ delay(500); // Change 'SS' to your Slave Select pin, if you arn't using the default pin - if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0){ + if (ether.begin(sizeof Ethernet::buffer, mymac, SS, false) == 0){ Serial.println( "Failed to access Ethernet controller"); continue; }