diff --git a/Conf.cpp b/Conf.cpp index 1327162..25e30f6 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -173,6 +173,7 @@ m_nextionIdleBrightness(20U), m_oledType(3U), m_oledBrightness(0U), m_oledInvert(false), +m_oledScroll(false), m_lcdprocAddress(), m_lcdprocPort(0U), m_lcdprocLocalPort(0U), @@ -571,6 +572,8 @@ bool CConf::read() m_oledBrightness = (unsigned char)::atoi(value); else if (::strcmp(key, "Invert") == 0) m_oledInvert = ::atoi(value) == 1; + else if (::strcmp(key, "Scroll") == 0) + m_oledScroll = ::atoi(value) == 1; } else if (section == SECTION_LCDPROC) { if (::strcmp(key, "Address") == 0) m_lcdprocAddress = value; @@ -1187,6 +1190,11 @@ bool CConf::getOLEDInvert() const return m_oledInvert; } +bool CConf::getOLEDScroll() const +{ + return m_oledScroll; +} + std::string CConf::getLCDprocAddress() const { return m_lcdprocAddress; diff --git a/Conf.h b/Conf.h index d47f5dd..b66c12d 100644 --- a/Conf.h +++ b/Conf.h @@ -186,6 +186,7 @@ public: unsigned char getOLEDType() const; unsigned char getOLEDBrightness() const; bool getOLEDInvert() const; + bool getOLEDScroll() const; // The LCDproc section std::string getLCDprocAddress() const; @@ -334,6 +335,7 @@ private: unsigned char m_oledType; unsigned char m_oledBrightness; bool m_oledInvert; + bool m_oledScroll; std::string m_lcdprocAddress; unsigned int m_lcdprocPort; diff --git a/MMDVM.ini b/MMDVM.ini index 6451ebd..1ab671e 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -165,6 +165,7 @@ IdleBrightness=20 Type=3 Brightness=0 Invert=0 +Scroll=1 [LCDproc] Address=localhost diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 14a96e4..3dae46e 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -1147,7 +1147,8 @@ void CMMDVMHost::createDisplay() unsigned char type = m_conf.getOLEDType(); unsigned char brightness = m_conf.getOLEDBrightness(); bool invert = m_conf.getOLEDInvert(); - m_display = new COLED(type, brightness, invert); + bool scroll = m_conf.getOLEDScroll(); + m_display = new COLED(type, brightness, invert, scroll); #endif } else { m_display = new CNullDisplay; diff --git a/OLED.cpp b/OLED.cpp index 2a0744f..7249542 100644 --- a/OLED.cpp +++ b/OLED.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 by Jonathan Naylor G4KLX + * Copyright (C) 2016,2017 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,10 +103,11 @@ const unsigned char logo_fusion_bmp [] = }; -COLED::COLED(unsigned char displayType, unsigned char displayBrightness, bool displayInvert) : +COLED::COLED(unsigned char displayType, unsigned char displayBrightness, bool displayInvert, bool displayScroll) : m_displayType(displayType), m_displayBrightness(displayBrightness), -m_displayInvert(displayInvert) +m_displayInvert(displayInvert), +m_displayScroll(displayScroll) { } @@ -379,16 +380,16 @@ void COLED::OLED_statusbar() display.setCursor(0,0); if (m_mode == MODE_DMR) - display.drawBitmap(0, 0, logo_dmr_bmp, 128, 16, WHITE); + display.drawBitmap(0, 0, logo_dmr_bmp, 128, 16, WHITE); else if (m_mode == MODE_DSTAR) - display.drawBitmap(0, 0, logo_dstar_bmp, 128, 16, WHITE); + display.drawBitmap(0, 0, logo_dstar_bmp, 128, 16, WHITE); else if (m_mode == MODE_YSF) - display.drawBitmap(0, 0, logo_fusion_bmp, 128, 16, WHITE); + display.drawBitmap(0, 0, logo_fusion_bmp, 128, 16, WHITE); else if (m_mode == MODE_P25) display.print("P25"); else display.drawBitmap(0, 0, logo_glcd_bmp, 128, 16, WHITE); -// display.startscrollright(0x00,0x02); //<-Uncomment this line to make the mode logo scroll - + if (m_displayScroll) + display.startscrollright(0x00,0x02); //<-Uncomment this line to make the mode logo scroll } diff --git a/OLED.h b/OLED.h index 3f7acb2..e822171 100644 --- a/OLED.h +++ b/OLED.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 by Jonathan Naylor G4KLX + * Copyright (C) 2016,2017 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ class COLED : public CDisplay { public: - COLED(unsigned char displayType, unsigned char displayBrighness, bool displayInvert); + COLED(unsigned char displayType, unsigned char displayBrighness, bool displayInvert, bool displayScroll); virtual ~COLED(); virtual bool open(); @@ -72,6 +72,7 @@ private: unsigned char m_displayType; unsigned char m_displayBrightness; bool m_displayInvert; + bool m_displayScroll; ArduiPi_OLED display; void OLED_statusbar();