From be5ca00b7e9aedaf06941a3c6c9f4ad71d168d73 Mon Sep 17 00:00:00 2001 From: Gregor Baues Date: Wed, 19 May 2021 15:33:08 +0200 Subject: [PATCH] Fixed constructor --- CommandStation-EX.ino.cpp | 115 ++++++++++++++++++++++++++++++++++++++ MQTTInterface.h | 4 +- 2 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 CommandStation-EX.ino.cpp diff --git a/CommandStation-EX.ino.cpp b/CommandStation-EX.ino.cpp new file mode 100644 index 0000000..3cb2445 --- /dev/null +++ b/CommandStation-EX.ino.cpp @@ -0,0 +1,115 @@ +# 1 "/var/folders/3z/5trn2qms2h75fpmtlsywh1c80000gn/T/tmplx9j4cov" +#include +# 1 "/Users/gregor/Projects/CommandStation-EX/CommandStation-EX.ino" +# 19 "/Users/gregor/Projects/CommandStation-EX/CommandStation-EX.ino" +#if __has_include("config.h") +#include "config.h" +#else +#warning config.h not found. Using defaults from config.example.h +#include "config.example.h" +#endif +# 45 "/Users/gregor/Projects/CommandStation-EX/CommandStation-EX.ino" +#include "DCCEX.h" + + + + +DCCEXParser serialParser; +void setup(); +void loop(); +#line 52 "/Users/gregor/Projects/CommandStation-EX/CommandStation-EX.ino" +void setup() +{ + + + + + Serial.begin(115200); + + CONDITIONAL_LCD_START + { + + LCD(0, F("DCC++ EX v%S"), F(VERSION)); + LCD(1, F("Starting")); + } + + + +#if WIFI_ON + WifiInterface::setup(WIFI_SERIAL_LINK_SPEED, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME), IP_PORT, WIFI_CHANNEL); +#endif + +#if ETHERNET_ON + EthernetInterface::setup(); +#endif + +#if MQTT_ON + MQTTInterface::setup(); +#endif +# 88 "/Users/gregor/Projects/CommandStation-EX/CommandStation-EX.ino" + DCC::begin(MOTOR_SHIELD_TYPE); + +#if defined(RMFT_ACTIVE) + RMFT::begin(); +#endif + +#if __has_include("mySetup.h") +#define SETUP(cmd) serialParser.parse(F(cmd)) +#include "mySetup.h" +#undef SETUP +#endif + +#if defined(LCN_SERIAL) + LCN_SERIAL.begin(115200); + LCN::init(LCN_SERIAL); +#endif + + + + LCD(1, F("Ready")); +} + +void loop() +{ + + + + + DCC::loop(); + + + serialParser.loop(Serial); + + +#if WIFI_ON + WifiInterface::loop(); +#endif + +#if ETHERNET_ON + EthernetInterface::loop(); +#endif + +#if MQTT_ON + MQTTInterface::loop(); +#endif + +#if defined(RMFT_ACTIVE) + RMFT::loop(); +#endif + +#if defined(LCN_SERIAL) + LCN::loop(); +#endif + + LCDDisplay::loop(); + + + static int ramLowWatermark = __INT_MAX__; + + int freeNow = minimumFreeMemory(); + if (freeNow < ramLowWatermark) + { + ramLowWatermark = freeNow; + LCD(2, F("Free RAM=%5db"), ramLowWatermark); + } +} \ No newline at end of file diff --git a/MQTTInterface.h b/MQTTInterface.h index d6cc72d..791b8a5 100644 --- a/MQTTInterface.h +++ b/MQTTInterface.h @@ -99,9 +99,9 @@ struct MQTTBroker }; // port & ip & prefix - MQTTBroker(int p, IPAddress i, const FSH *uid, const FSH *pass, const FSH *pfix) : port(p), ip(i), prefix(pfix), cType(1){}; + MQTTBroker(int p, IPAddress i, const FSH *pfix) : port(p), ip(i), prefix(pfix), cType(1){}; // port & domain & prefix - MQTTBroker(int p, const FSH *d, const FSH *uid, const FSH *pass, const FSH *pfix) : port(p), domain(d), prefix(pfix), cType(1) + MQTTBroker(int p, const FSH *d, const FSH *pfix) : port(p), domain(d), prefix(pfix), cType(1) { ip = resovleBroker(d); };