From 768dbc305fb77748c6c26a6c61f90525f3e0f8c3 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 13 Jun 2018 12:54:02 +0200 Subject: [PATCH 1/5] Add POCSAG display functions for OLED --- OLED.cpp | 30 ++++++++++++++++++++++++++++++ OLED.h | 3 +++ 2 files changed, 33 insertions(+) diff --git a/OLED.cpp b/OLED.cpp index d718a2a..5b9afe1 100644 --- a/OLED.cpp +++ b/OLED.cpp @@ -467,6 +467,36 @@ void COLED::clearNXDNInt() display.display(); } +void COLED::writePOCSAGInt(uint32_t ric, const std::string& message) +{ + m_mode = MODE_POCSAG; + + display.clearDisplay(); + display.fillRect(0, OLED_LINE1, display.width(), display.height(), BLACK); + + display.setCursor(0,OLED_LINE3); + display.printf("RIC: %u", ric); + + display.setCursor(0,OLED_LINE5); + display.printf("MSG: %s", message.c_str()); + + OLED_statusbar(); + display.display(); +} + +void COLED::clearPOCSAGInt() +{ + display.fillRect(0, OLED_LINE1, display.width(), display.height(), BLACK); + + display.setCursor(40,OLED_LINE4); + display.print("Listening"); + + display.setCursor(0,OLED_LINE6); + display.printf("%s",m_ipaddress.c_str()); + + display.display(); +} + void COLED::writeCWInt() { display.clearDisplay(); diff --git a/OLED.h b/OLED.h index 0379acd..2b05819 100644 --- a/OLED.h +++ b/OLED.h @@ -65,6 +65,9 @@ public: virtual void writeNXDNInt(const char* source, bool group, unsigned int dest, const char* type); virtual void clearNXDNInt(); + virtual void writePOCSAGInt(uint32_t ric, const std::string& message); + virtual void clearPOCSAGInt(); + virtual void writeCWInt(); virtual void clearCWInt(); From b56f037c0f48b62de232a540f3c2a309dc900d58 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 13 Jun 2018 13:07:06 +0200 Subject: [PATCH 2/5] Make the code more readable --- OLED.cpp | 293 +++++++++++++++++++++++++++---------------------------- 1 file changed, 145 insertions(+), 148 deletions(-) diff --git a/OLED.cpp b/OLED.cpp index 5b9afe1..0fe5a11 100644 --- a/OLED.cpp +++ b/OLED.cpp @@ -106,45 +106,45 @@ const unsigned char logo_fusion_bmp [] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - //Logo P25 128x16px - const unsigned char logo_P25_bmp [] = - { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x7f, -0xf8, 0x00, 0x00, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x7f, -0xf8, 0x00, 0xe0, 0x00, 0x00, 0xff, 0x00, 0x07, 0xc0, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, -0xf0, 0x01, 0xff, 0xfc, 0x00, 0x7e, 0x00, 0x3f, 0xf8, 0x00, 0xff, 0xe0, 0x0f, 0xff, 0xff, 0xff, -0xf0, 0x01, 0xff, 0xfe, 0x00, 0x7c, 0x00, 0x7f, 0xfc, 0x00, 0x7f, 0xe0, 0x0f, 0xff, 0xff, 0xff, -0xf0, 0x01, 0xff, 0xfe, 0x00, 0x7e, 0x00, 0x7f, 0xf8, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, -0xf0, 0x01, 0xff, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, -0xf0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0x00, 0x07, 0xff, 0xff, 0x9f, 0xff, 0x80, 0x07, -0xf0, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x03, -0xf0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x03, -0xf0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x1f, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0x03, -0xf0, 0x01, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xfe, 0x00, 0x0f, 0xfe, 0x00, 0x0f, -0xf0, 0x01, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x3f, -0xf0, 0x01, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x03, 0xff, +//Logo P25 128x16px +const unsigned char logo_P25_bmp [] = +{ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xf8, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x7f, +0xf8, 0x00, 0x00, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x7f, +0xf8, 0x00, 0xe0, 0x00, 0x00, 0xff, 0x00, 0x07, 0xc0, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x00, 0xff, +0xf0, 0x01, 0xff, 0xfc, 0x00, 0x7e, 0x00, 0x3f, 0xf8, 0x00, 0xff, 0xe0, 0x0f, 0xff, 0xff, 0xff, +0xf0, 0x01, 0xff, 0xfe, 0x00, 0x7c, 0x00, 0x7f, 0xfc, 0x00, 0x7f, 0xe0, 0x0f, 0xff, 0xff, 0xff, +0xf0, 0x01, 0xff, 0xfe, 0x00, 0x7e, 0x00, 0x7f, 0xf8, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xff, +0xf0, 0x01, 0xff, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, +0xf0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0x00, 0x07, 0xff, 0xff, 0x9f, 0xff, 0x80, 0x07, +0xf0, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x03, +0xf0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x03, +0xf0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x1f, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0x03, +0xf0, 0x01, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xfe, 0x00, 0x0f, 0xfe, 0x00, 0x0f, +0xf0, 0x01, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x3f, +0xf0, 0x01, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }; - +}; + // Logo NXDN_sm, 128x16px const unsigned char logo_NXDN_bmp [] = - { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -0xff, 0xf0, 0x1f, 0xf8, 0x0f, 0x00, 0xff, 0x80, 0x7c, 0x00, 0x0f, 0xff, 0x80, 0x7f, 0xe0, 0x7f, -0xff, 0xe0, 0x0f, 0xf0, 0x1f, 0x80, 0x7e, 0x01, 0xf8, 0x00, 0x00, 0x7f, 0x00, 0x3f, 0xc0, 0x7f, -0xff, 0xc0, 0x07, 0xe0, 0x3f, 0x80, 0x38, 0x07, 0xf0, 0x00, 0x00, 0x3e, 0x00, 0x3f, 0x80, 0xff, -0xff, 0x80, 0x03, 0xc0, 0x3f, 0xc0, 0x00, 0x3f, 0xe0, 0x1f, 0x80, 0x3e, 0x00, 0x1f, 0x01, 0xff, -0xff, 0x00, 0x03, 0x80, 0x7f, 0xe0, 0x00, 0xff, 0xc0, 0x3f, 0x80, 0x3c, 0x00, 0x0e, 0x03, 0xff, -0xfe, 0x00, 0x01, 0x00, 0xff, 0xe0, 0x03, 0xff, 0x80, 0x7f, 0x80, 0x78, 0x08, 0x04, 0x03, 0xff, -0xfc, 0x03, 0x00, 0x01, 0xff, 0x80, 0x01, 0xff, 0x00, 0xff, 0x00, 0xf0, 0x1c, 0x00, 0x07, 0xff, -0xfc, 0x07, 0x80, 0x03, 0xfc, 0x00, 0x01, 0xfe, 0x01, 0xfc, 0x01, 0xe0, 0x1e, 0x00, 0x0f, 0xff, -0xf8, 0x0f, 0xc0, 0x07, 0xf0, 0x0e, 0x00, 0xfc, 0x00, 0x00, 0x07, 0xc0, 0x3f, 0x00, 0x1f, 0xff, -0xf0, 0x1f, 0xe0, 0x0f, 0x80, 0x3f, 0x00, 0x7c, 0x00, 0x00, 0x3f, 0xc0, 0x7f, 0x80, 0x3f, 0xff, -0xe0, 0x3f, 0xf0, 0x0e, 0x01, 0xff, 0x80, 0x38, 0x00, 0x07, 0xff, 0x80, 0xff, 0x80, 0x7f, 0xff, -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +{ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xf0, 0x1f, 0xf8, 0x0f, 0x00, 0xff, 0x80, 0x7c, 0x00, 0x0f, 0xff, 0x80, 0x7f, 0xe0, 0x7f, +0xff, 0xe0, 0x0f, 0xf0, 0x1f, 0x80, 0x7e, 0x01, 0xf8, 0x00, 0x00, 0x7f, 0x00, 0x3f, 0xc0, 0x7f, +0xff, 0xc0, 0x07, 0xe0, 0x3f, 0x80, 0x38, 0x07, 0xf0, 0x00, 0x00, 0x3e, 0x00, 0x3f, 0x80, 0xff, +0xff, 0x80, 0x03, 0xc0, 0x3f, 0xc0, 0x00, 0x3f, 0xe0, 0x1f, 0x80, 0x3e, 0x00, 0x1f, 0x01, 0xff, +0xff, 0x00, 0x03, 0x80, 0x7f, 0xe0, 0x00, 0xff, 0xc0, 0x3f, 0x80, 0x3c, 0x00, 0x0e, 0x03, 0xff, +0xfe, 0x00, 0x01, 0x00, 0xff, 0xe0, 0x03, 0xff, 0x80, 0x7f, 0x80, 0x78, 0x08, 0x04, 0x03, 0xff, +0xfc, 0x03, 0x00, 0x01, 0xff, 0x80, 0x01, 0xff, 0x00, 0xff, 0x00, 0xf0, 0x1c, 0x00, 0x07, 0xff, +0xfc, 0x07, 0x80, 0x03, 0xfc, 0x00, 0x01, 0xfe, 0x01, 0xfc, 0x01, 0xe0, 0x1e, 0x00, 0x0f, 0xff, +0xf8, 0x0f, 0xc0, 0x07, 0xf0, 0x0e, 0x00, 0xfc, 0x00, 0x00, 0x07, 0xc0, 0x3f, 0x00, 0x1f, 0xff, +0xf0, 0x1f, 0xe0, 0x0f, 0x80, 0x3f, 0x00, 0x7c, 0x00, 0x00, 0x3f, 0xc0, 0x7f, 0x80, 0x3f, 0xff, +0xe0, 0x3f, 0xf0, 0x0e, 0x01, 0xff, 0x80, 0x38, 0x00, 0x07, 0xff, 0x80, 0xff, 0x80, 0x7f, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; @@ -176,10 +176,10 @@ bool COLED::open() { // I2C change parameters to fit to your LCD if ( !display.init(OLED_I2C_RESET, m_displayType) ) - return false; + return false; } - + display.begin(); display.invertDisplay(m_displayInvert ? 1 : 0); @@ -200,7 +200,7 @@ bool COLED::open() void COLED::setIdleInt() { - m_mode = MODE_IDLE; + m_mode = MODE_IDLE; display.clearDisplay(); OLED_statusbar(); @@ -212,26 +212,26 @@ void COLED::setIdleInt() // display.setTextSize(1); display.startscrolldiagright(0x00,0x0f); //the MMDVM logo scrolls the whole screen display.display(); - - unsigned char info[100U]; - CNetworkInfo* m_network; - - passCounter ++; - if (passCounter > 253U) - networkInfoInitialized = false; - - if (! networkInfoInitialized) { - //LogMessage("Initialize CNetworkInfo"); - info[0]=0; - m_network = new CNetworkInfo; - m_network->getNetworkInterface(info); - m_ipaddress = (char*)info; - delete m_network; - - networkInfoInitialized = true; - passCounter = 0; - } - + + unsigned char info[100U]; + CNetworkInfo* m_network; + + passCounter ++; + if (passCounter > 253U) + networkInfoInitialized = false; + + if (! networkInfoInitialized) { + //LogMessage("Initialize CNetworkInfo"); + info[0]=0; + m_network = new CNetworkInfo; + m_network->getNetworkInterface(info); + m_ipaddress = (char*)info; + delete m_network; + + networkInfoInitialized = true; + passCounter = 0; + } + } void COLED::setErrorInt(const char* text) @@ -277,9 +277,9 @@ void COLED::writeDStarInt(const char* my1, const char* my2, const char* your, co display.setCursor(0,OLED_LINE5); display.printf("via %.8s",reflector); - - display.setCursor(0,OLED_LINE6); - display.printf("%s",m_ipaddress.c_str()); + + display.setCursor(0,OLED_LINE6); + display.printf("%s",m_ipaddress.c_str()); OLED_statusbar(); display.display(); @@ -291,9 +291,9 @@ void COLED::clearDStarInt() display.setCursor(40,OLED_LINE3); display.print("Listening"); - - display.setCursor(0,OLED_LINE5); - display.printf("%s",m_ipaddress.c_str()); + + display.setCursor(0,OLED_LINE5); + display.printf("%s",m_ipaddress.c_str()); display.display(); } @@ -302,77 +302,74 @@ void COLED::writeDMRInt(unsigned int slotNo,const std::string& src,bool group,co { if (m_mode != MODE_DMR) { - display.clearDisplay(); - m_mode = MODE_DMR; - clearDMRInt(slotNo); - } - // if both slots, use lines 2-3 for slot 1, lines 4-5 for slot 2 - // if single slot, use lines 3-4 - if ( m_slot1Enabled && m_slot2Enabled ) { + display.clearDisplay(); + m_mode = MODE_DMR; + clearDMRInt(slotNo); + } + // if both slots, use lines 2-3 for slot 1, lines 4-5 for slot 2 + // if single slot, use lines 3-4 + if ( m_slot1Enabled && m_slot2Enabled ) { - if (slotNo == 1U) { - display.fillRect(0,OLED_LINE2,display.width(),40,BLACK); - display.setCursor(0,OLED_LINE2); - display.printf("%s",src.c_str()); - display.setCursor(0,OLED_LINE3); - display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "",dst.c_str()); - } - else - { - display.fillRect(0,OLED_LINE4,display.width(),40,BLACK); - display.setCursor(0,OLED_LINE4); - display.printf("%s",src.c_str()); - display.setCursor(0,OLED_LINE5); - display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "",dst.c_str()); - } + if (slotNo == 1U) { + display.fillRect(0,OLED_LINE2,display.width(),40,BLACK); + display.setCursor(0,OLED_LINE2); + display.printf("%s",src.c_str()); + display.setCursor(0,OLED_LINE3); + display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "",dst.c_str()); + } + else + { + display.fillRect(0,OLED_LINE4,display.width(),40,BLACK); + display.setCursor(0,OLED_LINE4); + display.printf("%s",src.c_str()); + display.setCursor(0,OLED_LINE5); + display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "",dst.c_str()); + } - } - else - { - display.fillRect(0,OLED_LINE3,display.width(),20,BLACK); - display.setCursor(0,OLED_LINE3); - display.printf("%s",src.c_str()); - display.setCursor(0,OLED_LINE4); - display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "",dst.c_str()); - } + } + else + { + display.fillRect(0,OLED_LINE3,display.width(),20,BLACK); + display.setCursor(0,OLED_LINE3); + display.printf("%s",src.c_str()); + display.setCursor(0,OLED_LINE4); + display.printf("Slot: %i %s %s%s",slotNo,type,group ? "TG: " : "",dst.c_str()); + } + + display.fillRect(0,OLED_LINE6,display.width(),20,BLACK); + display.setCursor(0,OLED_LINE6); + display.printf("%s",m_ipaddress.c_str()); - display.fillRect(0,OLED_LINE6,display.width(),20,BLACK); - display.setCursor(0,OLED_LINE6); - display.printf("%s",m_ipaddress.c_str()); - OLED_statusbar(); display.display(); - } + } void COLED::clearDMRInt(unsigned int slotNo) { - // if both slots, use lines 2-3 for slot 1, lines 4-5 for slot 2 - // if single slot, use lines 3-4 - if ( m_slot1Enabled && m_slot2Enabled ){ - if (slotNo == 1U) - { - display.fillRect(0, OLED_LINE3, display.width(), 40, BLACK); - display.setCursor(0,OLED_LINE3); - display.print("Slot: 1 Listening"); - } - else - { - display.fillRect(0, OLED_LINE5, display.width(), 40, BLACK); - display.setCursor(0, OLED_LINE5); - display.print("Slot: 2 Listening"); - } - } - else { - display.fillRect(0, OLED_LINE4, display.width(), 40, BLACK); - display.setCursor(0,OLED_LINE4); - display.printf("Slot: %i Listening",slotNo); - } + // if both slots, use lines 2-3 for slot 1, lines 4-5 for slot 2 + // if single slot, use lines 3-4 + if ( m_slot1Enabled && m_slot2Enabled ){ + if (slotNo == 1U) { + display.fillRect(0, OLED_LINE3, display.width(), 40, BLACK); + display.setCursor(0,OLED_LINE3); + display.print("Slot: 1 Listening"); + } + else { + display.fillRect(0, OLED_LINE5, display.width(), 40, BLACK); + display.setCursor(0, OLED_LINE5); + display.print("Slot: 2 Listening"); + } + } + else { + display.fillRect(0, OLED_LINE4, display.width(), 40, BLACK); + display.setCursor(0,OLED_LINE4); + display.printf("Slot: %i Listening",slotNo); + } - - display.fillRect(0, OLED_LINE6, display.width(), 20, BLACK); - display.setCursor(0,OLED_LINE6); - display.printf("%s",m_ipaddress.c_str()); + display.fillRect(0, OLED_LINE6, display.width(), 20, BLACK); + display.setCursor(0,OLED_LINE6); + display.printf("%s",m_ipaddress.c_str()); display.display(); } @@ -400,9 +397,9 @@ void COLED::clearFusionInt() display.setCursor(40,OLED_LINE4); display.print("Listening"); - - display.setCursor(0,OLED_LINE6); - display.printf("%s",m_ipaddress.c_str()); + + display.setCursor(0,OLED_LINE6); + display.printf("%s",m_ipaddress.c_str()); display.display(); } @@ -430,9 +427,9 @@ void COLED::clearP25Int() display.setCursor(40,OLED_LINE4); display.print("Listening"); - - display.setCursor(0,OLED_LINE6); - display.printf("%s",m_ipaddress.c_str()); + + display.setCursor(0,OLED_LINE6); + display.printf("%s",m_ipaddress.c_str()); display.display(); } @@ -460,9 +457,9 @@ void COLED::clearNXDNInt() display.setCursor(40,OLED_LINE4); display.print("Listening"); - - display.setCursor(0,OLED_LINE6); - display.printf("%s",m_ipaddress.c_str()); + + display.setCursor(0,OLED_LINE6); + display.printf("%s",m_ipaddress.c_str()); display.display(); } @@ -490,9 +487,9 @@ void COLED::clearPOCSAGInt() display.setCursor(40,OLED_LINE4); display.print("Listening"); - - display.setCursor(0,OLED_LINE6); - display.printf("%s",m_ipaddress.c_str()); + + display.setCursor(0,OLED_LINE6); + display.printf("%s",m_ipaddress.c_str()); display.display(); } @@ -526,13 +523,13 @@ void COLED::clearCWInt() void COLED::close() { display.clearDisplay(); - display.fillRect(0, 0, display.width(), 16, BLACK); - display.startscrollright(0x00,0x01); + display.fillRect(0, 0, display.width(), 16, BLACK); + display.startscrollright(0x00,0x01); display.setCursor(0,00); display.setTextSize(2); display.print("-CLOSE-"); display.display(); - + display.close(); } @@ -544,18 +541,18 @@ 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.drawBitmap(0, 0, logo_P25_bmp, 128, 16, WHITE); + display.drawBitmap(0, 0, logo_P25_bmp, 128, 16, WHITE); else if (m_mode == MODE_NXDN) - display.drawBitmap(0, 0, logo_NXDN_bmp, 128, 16, WHITE); + display.drawBitmap(0, 0, logo_NXDN_bmp, 128, 16, WHITE); else - display.drawBitmap(0, 0, logo_glcd_bmp, 128, 16, WHITE); + display.drawBitmap(0, 0, logo_glcd_bmp, 128, 16, WHITE); if (m_displayScroll) - display.startscrollright(0x00,0x02); + display.startscrollright(0x00,0x02); } From e24c6e82a874375f68f2a90cc88469226ff7b405 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 13 Jun 2018 13:18:32 +0200 Subject: [PATCH 3/5] Fix forgotten "Int" --- HD44780.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HD44780.h b/HD44780.h index c485a15..6f5abfb 100644 --- a/HD44780.h +++ b/HD44780.h @@ -121,7 +121,7 @@ protected: virtual void writeNXDNRSSIInt(unsigned char rssi); virtual void clearNXDNInt(); - virtual void writePOCSAG(uint32_t ric, const std::string& message); + virtual void writePOCSAGInt(uint32_t ric, const std::string& message); virtual void clearPOCSAGInt(); virtual void writeCWInt(); From e5ed902e406473c8c0b9292cf5ff3512f1bcf609 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 13 Jun 2018 13:36:28 +0200 Subject: [PATCH 4/5] Add POCSAG logo for OLED --- OLED.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/OLED.cpp b/OLED.cpp index 0fe5a11..c5db400 100644 --- a/OLED.cpp +++ b/OLED.cpp @@ -148,6 +148,28 @@ const unsigned char logo_NXDN_bmp [] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +// Logo POCASG/DAPNET, 128x16px +// 'POCSAG', 128x16px +const unsigned char logo_POCSAG_bmp [] = +{ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +0xff, 0xff, 0xff, 0xf8, 0x7f, 0xfe, 0x03, 0xfe, 0xfe, 0x03, 0xdf, 0xf6, 0x00, 0x00, 0x1f, 0xff +0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xfc, 0xfc, 0xfe, 0xfc, 0xcf, 0xf6, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xfe, 0x7d, 0x7e, 0xfe, 0xc7, 0xf6, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xfb, 0x7a, 0x7e, 0xff, 0x79, 0x7e, 0xfe, 0xd3, 0xf6, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xff, 0xf7, 0xbe, 0xff, 0x7b, 0xbe, 0xfe, 0xdb, 0xf6, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xff, 0xbb, 0xbe, 0xfe, 0xdd, 0xf6, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xf9, 0xff, 0xbe, 0xff, 0xb7, 0xde, 0xfe, 0xde, 0xf6, 0x01, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xee, 0x77, 0xbe, 0xff, 0xb7, 0xde, 0x81, 0xde, 0x76, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xdf, 0xb7, 0x7e, 0xff, 0xa0, 0x1e, 0xff, 0xdf, 0x36, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xdf, 0xbc, 0xfe, 0xff, 0x6f, 0xee, 0xff, 0xdf, 0xb6, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xdf, 0xbf, 0xfe, 0xff, 0x6f, 0xee, 0xff, 0xdf, 0xd6, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xdf, 0xbf, 0xfe, 0xfe, 0xdf, 0xf6, 0xff, 0xdf, 0xe6, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xdf, 0x7f, 0xfe, 0xf9, 0xdf, 0xf6, 0xff, 0xdf, 0xe6, 0xff, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xe6, 0x7f, 0xfe, 0x07, 0xff, 0xf6, 0xff, 0xdf, 0xf6, 0x00, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +}; + COLED::COLED(unsigned char displayType, unsigned char displayBrightness, bool displayInvert, bool displayScroll, bool slot1Enabled, bool slot2Enabled) : m_displayType(displayType), m_displayBrightness(displayBrightness), @@ -550,6 +572,8 @@ void COLED::OLED_statusbar() display.drawBitmap(0, 0, logo_P25_bmp, 128, 16, WHITE); else if (m_mode == MODE_NXDN) display.drawBitmap(0, 0, logo_NXDN_bmp, 128, 16, WHITE); + else if (m_mode == MODE_POCSAG) + display.drawBitmap(0, 0, logo_POCSAG_bmp, 128, 16, WHITE); else display.drawBitmap(0, 0, logo_glcd_bmp, 128, 16, WHITE); From e513a2c6bd5f6b4e01ddc7a2daa5954ea0e88075 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 13 Jun 2018 13:39:05 +0200 Subject: [PATCH 5/5] Add missing commas --- OLED.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/OLED.cpp b/OLED.cpp index c5db400..72bfece 100644 --- a/OLED.cpp +++ b/OLED.cpp @@ -149,24 +149,23 @@ const unsigned char logo_NXDN_bmp [] = }; // Logo POCASG/DAPNET, 128x16px -// 'POCSAG', 128x16px const unsigned char logo_POCSAG_bmp [] = { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -0xff, 0xff, 0xff, 0xf8, 0x7f, 0xfe, 0x03, 0xfe, 0xfe, 0x03, 0xdf, 0xf6, 0x00, 0x00, 0x1f, 0xff -0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xfc, 0xfc, 0xfe, 0xfc, 0xcf, 0xf6, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xfe, 0x7d, 0x7e, 0xfe, 0xc7, 0xf6, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xfb, 0x7a, 0x7e, 0xff, 0x79, 0x7e, 0xfe, 0xd3, 0xf6, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xff, 0xf7, 0xbe, 0xff, 0x7b, 0xbe, 0xfe, 0xdb, 0xf6, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xff, 0xbb, 0xbe, 0xfe, 0xdd, 0xf6, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xf9, 0xff, 0xbe, 0xff, 0xb7, 0xde, 0xfe, 0xde, 0xf6, 0x01, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xee, 0x77, 0xbe, 0xff, 0xb7, 0xde, 0x81, 0xde, 0x76, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xdf, 0xb7, 0x7e, 0xff, 0xa0, 0x1e, 0xff, 0xdf, 0x36, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xdf, 0xbc, 0xfe, 0xff, 0x6f, 0xee, 0xff, 0xdf, 0xb6, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xdf, 0xbf, 0xfe, 0xff, 0x6f, 0xee, 0xff, 0xdf, 0xd6, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xdf, 0xbf, 0xfe, 0xfe, 0xdf, 0xf6, 0xff, 0xdf, 0xe6, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xdf, 0x7f, 0xfe, 0xf9, 0xdf, 0xf6, 0xff, 0xdf, 0xe6, 0xff, 0xfb, 0xff, 0xff -0xff, 0xff, 0xff, 0xe6, 0x7f, 0xfe, 0x07, 0xff, 0xf6, 0xff, 0xdf, 0xf6, 0x00, 0xfb, 0xff, 0xff +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xf8, 0x7f, 0xfe, 0x03, 0xfe, 0xfe, 0x03, 0xdf, 0xf6, 0x00, 0x00, 0x1f, 0xff, +0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xfc, 0xfc, 0xfe, 0xfc, 0xcf, 0xf6, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xfe, 0x7d, 0x7e, 0xfe, 0xc7, 0xf6, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xfb, 0x7a, 0x7e, 0xff, 0x79, 0x7e, 0xfe, 0xd3, 0xf6, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xf7, 0xbe, 0xff, 0x7b, 0xbe, 0xfe, 0xdb, 0xf6, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xff, 0xbb, 0xbe, 0xfe, 0xdd, 0xf6, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xf9, 0xff, 0xbe, 0xff, 0xb7, 0xde, 0xfe, 0xde, 0xf6, 0x01, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xee, 0x77, 0xbe, 0xff, 0xb7, 0xde, 0x81, 0xde, 0x76, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xdf, 0xb7, 0x7e, 0xff, 0xa0, 0x1e, 0xff, 0xdf, 0x36, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xdf, 0xbc, 0xfe, 0xff, 0x6f, 0xee, 0xff, 0xdf, 0xb6, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xdf, 0xbf, 0xfe, 0xff, 0x6f, 0xee, 0xff, 0xdf, 0xd6, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xdf, 0xbf, 0xfe, 0xfe, 0xdf, 0xf6, 0xff, 0xdf, 0xe6, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xdf, 0x7f, 0xfe, 0xf9, 0xdf, 0xf6, 0xff, 0xdf, 0xe6, 0xff, 0xfb, 0xff, 0xff, +0xff, 0xff, 0xff, 0xe6, 0x7f, 0xfe, 0x07, 0xff, 0xf6, 0xff, 0xdf, 0xf6, 0x00, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };