From 883ac61fc73a155a82da24a143f762d3613ffed7 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 27 Dec 2020 21:43:05 +0100 Subject: [PATCH 1/4] spell names like on github --- platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 1da1627..e0a0ad8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -37,9 +37,9 @@ lib_deps = arduino-libraries/Ethernet SPI marcoschwartz/LiquidCrystal_I2C - adafruit/Adafruit BusIO - adafruit/Adafruit SSD1306 - adafruit/Adafruit GFX Library + Adafruit/Adafruit_BusIO + Adafruit/Adafruit_SSD1306 + Adafruit/Adafruit-GFX-Library monitor_speed = 115200 monitor_flags = --echo From c8bf4347c22925bf2feac8dbbdd7246dd3766283 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sun, 27 Dec 2020 21:41:00 +0000 Subject: [PATCH 2/4] Update DCCWaveform.cpp (#109) Anti-jitter Prevents main track interrupt taking a variable time which causes prog track jitter. --- DCCWaveform.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DCCWaveform.cpp b/DCCWaveform.cpp index 123ba9e..9eb7022 100644 --- a/DCCWaveform.cpp +++ b/DCCWaveform.cpp @@ -188,13 +188,17 @@ bool DCCWaveform::interrupt1() { setSignal(LOW); state = 0; } - else state = 2; + else { + setSignal(HIGH); // jitter prevention + state = 2; + } break; case 2: // 116us after case 0 setSignal(LOW); state = 3; break; case 3: // finished sending zero bit + setSignal(LOW); // jitter prevention state = 0; break; } From 7963b0283931cac0ca43a239ec53fe6c8eebb526 Mon Sep 17 00:00:00 2001 From: Fred Date: Sun, 27 Dec 2020 17:27:22 -0500 Subject: [PATCH 3/4] Update config.example.h Modify example config for Ethernet Shield use --- config.example.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config.example.h b/config.example.h index 0c2d137..b588e50 100644 --- a/config.example.h +++ b/config.example.h @@ -96,7 +96,18 @@ The configuration file for DCC++ EX Command Station // // Uncomment to use with Ethernet Shields // +// Ethernet Shields do not have have a MAC address in hardware. There may be one on +// a sticker on the Shield that you should use. Otherwise choose one of the ones below +// Be certain that no other device on your network has this same MAC address! +// +// 52:b8:8a:8e:ce:21 +// e3:e9:73:e1:db:0d +// 54:2b:13:52:ac:0c + // NOTE: This is not used with ESP8266 WiFi modules. + +//#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 + // // #define MAC_ADDRESS { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEF } From d70f76e80ea870a2d50b088370ae9cf0fc5ab4d0 Mon Sep 17 00:00:00 2001 From: ADA Date: Mon, 28 Dec 2020 00:06:31 +0100 Subject: [PATCH 4/4] 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 --- EthernetInterface.cpp | 4 ++++ EthernetInterface.h | 18 ++++-------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index 1cc41b8..ebc21c4 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -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")); diff --git a/EthernetInterface.h b/EthernetInterface.h index 6350289..7b4c2f8 100644 --- a/EthernetInterface.h +++ b/EthernetInterface.h @@ -30,24 +30,14 @@ #include #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