From 3b09e2cf2f1988395ae6bca5216446bcfbf80fa5 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 22 Jun 2016 14:13:22 +0200 Subject: [PATCH] Renamed English to British and added American (MDY) --- Conf.cpp | 4 ++-- HD44780.cpp | 4 +++- MMDVM.ini | 3 ++- Nextion.cpp | 4 +++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Conf.cpp b/Conf.cpp index bbbdbf6..a9d0220 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -135,12 +135,12 @@ m_hd44780PWMBright(), m_hd44780PWMDim(), m_hd44780DisplayClock(false), m_hd44780UTC(false), -m_hd44780DateFormat("English"), +m_hd44780DateFormat("British"), m_nextionPort("/dev/ttyAMA0"), m_nextionBrightness(50U), m_nextionDisplayClock(false), m_nextionUTC(false), -m_nextionDateFormat("English"), +m_nextionDateFormat("British"), m_oledType(3), m_oledBrightness(0), m_oledInvert(0) diff --git a/HD44780.cpp b/HD44780.cpp index 6429570..7721ea7 100644 --- a/HD44780.cpp +++ b/HD44780.cpp @@ -735,10 +735,12 @@ void CHD44780::clockInt(unsigned int ms) if (m_cols != 16U && m_rows != 2U) { ::lcdPosition(m_fd, (m_cols - 8) / 2, m_rows == 2 ? 0 : 1); - if (strcmp(m_dateformat.c_str(), "English") == 0) { + if (strcmp(m_dateformat.c_str(), "British") == 0) { ::lcdPrintf(m_fd, "%02d/%02d/%2d", Day, Month, Year%100); } else if (strcmp(m_dateformat.c_str(), "German") == 0) { ::lcdPrintf(m_fd, "%02d.%02d.%2d", Day, Month, Year%100); + } else if (strcmp(m_dateformat.c_str(), "American") == 0) { + ::lcdPrintf(m_fd, "%02d/%02d/%2d", Month, Day, Year%100); } } m_clockDisplayTimer.start(); diff --git a/MMDVM.ini b/MMDVM.ini index 1f74d33..470b5ff 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -118,13 +118,14 @@ PWMBright=100 PWMDim=16 DisplayClock=1 UTC=0 +DateFormat=British [Nextion] Port=/dev/ttyAMA0 Brightness=50 DisplayClock=1 UTC=0 -DateFormat=English +DateFormat=British [OLED] Type=3 diff --git a/Nextion.cpp b/Nextion.cpp index dfe75ca..f3e503d 100644 --- a/Nextion.cpp +++ b/Nextion.cpp @@ -242,10 +242,12 @@ void CNextion::clockInt(unsigned int ms) int Sec = Time->tm_sec; char text[50U]; - if (strcmp(m_dateformat.c_str(), "English") == 0) { + if (strcmp(m_dateformat.c_str(), "British") == 0) { ::sprintf(text, "t2.txt=\"%02d:%02d:%02d %02d/%02d/%2d\"", Hour, Min, Sec, Day, Month, Year % 100); } else if (strcmp(m_dateformat.c_str(), "German") == 0) { ::sprintf(text, "t2.txt=\"%02d:%02d:%02d %02d.%02d.%2d\"", Hour, Min, Sec, Day, Month, Year % 100); + } else if (strcmp(m_dateformat.c_str(), "American") == 0) { + ::sprintf(text, "t2.txt=\"%02d:%02d:%02d %02d/%02d/%2d\"", Hour, Min, Sec, Month, Day, Year % 100); } sendCommand(text);