Move modbus params to options.h

This commit is contained in:
2018-05-06 17:57:28 +03:00
parent b7331beab4
commit 7cce5eeda3
2 changed files with 18 additions and 9 deletions

View File

@@ -285,10 +285,15 @@ if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1;
else Ethernet.begin(mac,ip,dns,gw); else Ethernet.begin(mac,ip,dns,gw);
else Ethernet.begin(mac,ip,dns); else Ethernet.begin(mac,ip,dns);
else Ethernet.begin(mac,ip); else Ethernet.begin(mac,ip);
else res = Ethernet.begin(mac, 12000); else
{
wdt_dis();
res = Ethernet.begin(mac, 12000);
wdt_en();
wdt_res();
}
wdt_dis();
if (res == 0) { if (res == 0) {
Serial.println(F("Failed to configure Ethernet using DHCP")); Serial.println(F("Failed to configure Ethernet using DHCP"));
lanStatus = -10; lanStatus = -10;
@@ -297,8 +302,7 @@ if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1;
printIPAddress(); printIPAddress();
lanStatus = 1; lanStatus = 1;
} }
wdt_en();
wdt_res();
#endif #endif
break; break;
@@ -997,7 +1001,11 @@ void setup_main() {
#ifdef _artnet #ifdef _artnet
ArtnetSetup(); ArtnetSetup();
#endif #endif
/*
SPI.begin();
while (Ethernet.maintain() == NO_LINK && millis()<3000UL) {delay(500);Serial.print(F("."));}
*/
delay(1000); //Wiz5500
//TODO: checkForRemoteSketchUpdate(); //TODO: checkForRemoteSketchUpdate();
} }

View File

@@ -1,6 +1,6 @@
// Configuration of drivers enabled // Configuration of drivers enabled
#ifndef PIO_SRC_REV #ifndef PIO_SRC_REV
#define PIO_SRC_REV v0.997 #define PIO_SRC_REV v0.998
#endif #endif
#define TXEnablePin 13 #define TXEnablePin 13
@@ -20,7 +20,8 @@
#define OFFSET_GW OFFSET_DNS+4 #define OFFSET_GW OFFSET_DNS+4
#define OFFSET_MASK OFFSET_GW+4 #define OFFSET_MASK OFFSET_GW+4
#define OFFSET_CONFIGSERVER OFFSET_MASK+4 #define OFFSET_CONFIGSERVER OFFSET_MASK+4
#define EEPROM_offset OFFSET_CONFIGSERVER+32 #define OFFSET_MQTT_PWD OFFSET_CONFIGSERVER+32
#define EEPROM_offset OFFSET_MQTT_PWD+16
#define INTERVAL_CHECK_INPUT 50 #define INTERVAL_CHECK_INPUT 50
#define INTERVAL_CHECK_MODBUS 2000 #define INTERVAL_CHECK_MODBUS 2000
@@ -46,11 +47,11 @@
#endif #endif
#ifndef OUTTOPIC #ifndef OUTTOPIC
#define OUTTOPIC "/myhome/s_out1/" #define OUTTOPIC "/myhome/s_out/"
#endif #endif
#ifndef INTOPIC #ifndef INTOPIC
#define INTOPIC "/myhome/in1/" #define INTOPIC "/myhome/in/"
#endif #endif
#define MQTT_SUBJECT_LENGTH 20 #define MQTT_SUBJECT_LENGTH 20