Fixed issue "Strange behavior on restart if lan is not initialized #22"

This commit is contained in:
2018-06-24 22:08:08 +03:00
parent bfee598017
commit f219951630
2 changed files with 29 additions and 3 deletions

View File

@@ -620,6 +620,7 @@ void applyConfig() {
if (owArr && !owReady) { if (owArr && !owReady) {
aJsonObject *item = owArr->child; aJsonObject *item = owArr->child;
owReady = owSetup(&Changed); owReady = owSetup(&Changed);
if (owReady) Serial.println(F("One wire Ready"));
t_count = 0; t_count = 0;
while (item && owReady) { while (item && owReady) {
if ((item->type == aJson_Object)) { if ((item->type == aJson_Object)) {
@@ -1025,7 +1026,7 @@ pinMode(TXEnablePin, OUTPUT);
#endif #endif
delay(20); delay(20);
owReady = 0; //owReady = 0;
#ifdef _owire #ifdef _owire
if (net) net->idle(&owIdle); if (net) net->idle(&owIdle);

View File

@@ -12,8 +12,8 @@ src_dir = lighthub
env_default = env_default =
; due-5500 ; due-5500
; controllino ; controllino
; megaatmega2560 megaatmega2560-net
megaatmega2560-5500 ; megaatmega2560-5500
; due ; due
; esp8266 ; esp8266
@@ -64,6 +64,30 @@ lib_deps =
; 161 ; 161
; 322 ; 322
[env:megaatmega2560-net]
platform = atmelavr
board = megaatmega2560
framework = arduino
upload_port = net:192.168.88.2:23000
;lib_ldf_mode = chain+
build_flags = !echo -n "-DPIO_SRC_REV="$(git rev-parse --short HEAD)
lib_deps =
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
https://github.com/anklimov/DS2482_OneWire
https://github.com/anklimov/DmxSimple
https://github.com/anklimov/httpClient
https://github.com/anklimov/aJson
https://github.com/anklimov/CmdArduino
https://github.com/anklimov/ModbusMaster
https://github.com/anklimov/DMXSerial
https://github.com/anklimov/Ethernet
https://github.com/PaulStoffregen/SPI.git
https://github.com/knolleary/pubsubclient.git
https://github.com/anklimov/Artnet.git
FastLED
[env:controllino] [env:controllino]
platform = atmelavr platform = atmelavr
board = megaatmega2560 board = megaatmega2560
@@ -107,6 +131,7 @@ lib_deps =
; https://github.com/PaulStoffregen/SPI.git ; https://github.com/PaulStoffregen/SPI.git
https://github.com/knolleary/pubsubclient.git https://github.com/knolleary/pubsubclient.git
https://github.com/anklimov/Artnet.git https://github.com/anklimov/Artnet.git
https://github.com/brokentoaster/Syslog
FastLED FastLED
; 161 ; 161
; 322 ; 322