From ecb11ce3a522a020e350e1ff74c682ba477150ef Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Sat, 9 Feb 2019 12:51:34 +0300 Subject: [PATCH] DeviceID based default MAC for DUE, fix for artnet hungs w/o LAN fixed --- lighthub/main.cpp | 14 ++++++++++---- lighthub/owTerm.cpp | 1 - 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lighthub/main.cpp b/lighthub/main.cpp index 9b3df27..3e0aee1 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -1339,11 +1339,17 @@ void publishStat(){ } void setupMacAddress() { - +#if defined(__SAM3X8E__) +byte firmwareMacAddress[6]; +firmwareMacAddress[0]=0xDE; +firmwareMacAddress[1]=0xAD; +for (byte b = 0 ; b < 4 ; b++) + firmwareMacAddress[b+2]=UniqueID [b] ; +#else #ifdef DEFAULT_FIRMWARE_MAC byte firmwareMacAddress[6] = DEFAULT_FIRMWARE_MAC;//comma(,) separated hex-array, hard-coded #endif - +#endif #ifdef CUSTOM_FIRMWARE_MAC byte firmwareMacAddress[6]; const char *macStr = QUOTE(CUSTOM_FIRMWARE_MAC);//colon(:) separated from build options @@ -1356,7 +1362,7 @@ void setupMacAddress() { if (mac[i] != 0 && mac[i] != 0xff) isMacValid = true; } if (!isMacValid) { - debugSerial<read(); + if (artnet && (lanStatus>=HAVE_IP_ADDRESS)) artnet->read(); #endif wdt_res(); diff --git a/lighthub/owTerm.cpp b/lighthub/owTerm.cpp index 1f00e55..3958fc8 100644 --- a/lighthub/owTerm.cpp +++ b/lighthub/owTerm.cpp @@ -153,7 +153,6 @@ int sensors_loop(void) { case 0x28: // Thermomerer t = sensors->getTempC(term[si]);//*10.0; - //Serial.println("o"); if (owChanged) owChanged(si, term[si], t); sensors->requestTemperaturesByAddress(term[si]); si++;