1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 01:56:14 +01:00

Fix for flash memory usage per Haba

This commit is contained in:
dexslab 2020-09-22 15:57:26 -04:00
parent eb887fdbd2
commit 37ab4d222f

View File

@ -118,21 +118,26 @@ void setup()
#if ENABLE_WIFI #if ENABLE_WIFI
#if defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) #if defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560)
bool wifiUp = false; bool wifiUp = false;
const __FlashStringHelper *wifiESSID = F(WIFI_SSID);
const __FlashStringHelper *wifiPassword = F(WIFI_PASSWORD);
const __FlashStringHelper *dccex = F(WIFI_HOSTNAME);
const uint16_t port = WIFI_PORT;
Serial1.begin(WIFI_SERIAL_LINK_SPEED); Serial1.begin(WIFI_SERIAL_LINK_SPEED);
wifiUp = WifiInterface::setup(Serial1, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME), WIFI_PORT); wifiUp = WifiInterface::setup(Serial1, wifiESSID, wifiPassword, dccex, port);
#if defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560)
if (!wifiUp) if (!wifiUp)
{ {
Serial2.begin(WIFI_SERIAL_LINK_SPEED); Serial2.begin(WIFI_BAUD);
wifiUp = WifiInterface::setup(Serial2, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME), WIFI_PORT); wifiUp = WifiInterface::setup(Serial2, wifiESSID, wifiPassword, dccex, port);
} }
if (!wifiUp) if (!wifiUp)
{ {
Serial3.begin(WIFI_SERIAL_LINK_SPEED); Serial3.begin(WIFI_BAUD);
wifiUp = WifiInterface::setup(Serial3, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME), WIFI_PORT); wifiUp = WifiInterface::setup(Serial3, wifiESSID, wifiPassword, dccex, port);
} }
#endif #endif
#endif
#endif #endif
// Responsibility 3: Start the DCC engine. // Responsibility 3: Start the DCC engine.
@ -145,7 +150,7 @@ void setup()
// Optionally a Timer number (1..4) may be passed to DCC::begin to override the default Timer1 used for the // Optionally a Timer number (1..4) may be passed to DCC::begin to override the default Timer1 used for the
// waveform generation. e.g. DCC::begin(STANDARD_MOTOR_SHIELD,2); to use timer 2 // waveform generation. e.g. DCC::begin(STANDARD_MOTOR_SHIELD,2); to use timer 2
DCC::begin(STANDARD_MOTOR_SHIELD); DCC::begin(MOTOR_SHIELD_TYPE);
} }
void loop() void loop()