From 7b5e2b41da918e76faeda6a074b37de6b25fde46 Mon Sep 17 00:00:00 2001 From: FranziHH <45534937+FranziHH@users.noreply.github.com> Date: Sun, 3 Sep 2023 16:09:26 +0200 Subject: [PATCH] new config options For Display Shows IP and Port in same Line: PRINT_IP_PORT_SINGLE_LINE Shows FastClock readable: FASTCLOCK_READABLE --- CommandDistributor.cpp | 15 ++++++++++++++- WifiInterface.cpp | 10 ++++++++-- config.example.h | 8 ++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CommandDistributor.cpp b/CommandDistributor.cpp index ab6b52f..52169b5 100644 --- a/CommandDistributor.cpp +++ b/CommandDistributor.cpp @@ -181,7 +181,20 @@ void CommandDistributor::setClockTime(int16_t clocktime, int8_t clockrate, byte case 1: if (clocktime != lastclocktime){ // CAH. DIAG removed because LCD does it anyway. - LCD(6,F("Clk Time:%d Sp %d"), clocktime, clockrate); + + #ifndef FASTCLOCK_READABLE + LCD(6,F("Clk Time: %d Sp %d"), clocktime, clockrate); + #else + // Make Time readable + int hours = clocktime / 60; + int minutes = clocktime - (hours * 60); + int hoursH = hours / 10; + int hoursL = hours - (hoursH * 10); + int minutesH = minutes / 10; + int minutesL = minutes - (minutesH * 10); + LCD(6,F("Clk Time: %d%d:%d%d Sp %d"), hoursH, hoursL, minutesH, minutesL, clockrate); + #endif + // look for an event for this time RMFT2::clockEvent(clocktime,1); // Now tell everyone else what the time is. diff --git a/WifiInterface.cpp b/WifiInterface.cpp index 7511af6..38a65c4 100644 --- a/WifiInterface.cpp +++ b/WifiInterface.cpp @@ -347,11 +347,17 @@ wifiSerialState WifiInterface::setup2(const FSH* SSid, const FSH* password, } ipString[ipLen]=ipChar; } - LCD(4,F("%s"),ipString); // There is not enough room on some LCDs to put a title to this + #ifndef PRINT_IP_PORT_SINGLE_LINE + LCD(4,F("%s"),ipString); // There is not enough room on some LCDs to put a title to this + #else + LCD(4,F("%s:%d"),ipString,port); // *** Single IP:Port + #endif } // suck up anything after the IP. if (!checkForOK(1000, true, false)) return WIFI_DISCONNECTED; - LCD(5,F("PORT=%d"),port); + #ifndef PRINT_IP_PORT_SINGLE_LINE + LCD(5,F("PORT=%d"),port); + #endif return WIFI_CONNECTED; } diff --git a/config.example.h b/config.example.h index 505d2b7..1570139 100644 --- a/config.example.h +++ b/config.example.h @@ -167,6 +167,9 @@ The configuration file for DCC-EX Command Station // * #define SCROLLMODE 2 is by row (move up 1 row at a time). #define SCROLLMODE 1 +// Shows IP and Port on Display in a single line +// #define PRINT_IP_PORT_SINGLE_LINE + ///////////////////////////////////////////////////////////////////////////////////// // DISABLE EEPROM // @@ -256,6 +259,11 @@ The configuration file for DCC-EX Command Station //#define FAST_CLOCK_I2C 0x55 // default is 0x55 // ------------------------------------- // +// ------------------------------------- +// FastClock in HH:MM on Display +//#define FASTCLOCK_READABLE +// ------------------------------------- +// // BLUETOOTH SERIAL ON ESP32 // On ESP32 you have the possibility to use the builtin BT serial to connect to // the CS.