Add output of callsign/DMRid on LCD idle screen

This commit is contained in:
phl0 2016-04-07 22:20:44 +02:00
parent a9b5f44bee
commit 9fb57309a1
3 changed files with 11 additions and 5 deletions

View file

@ -27,9 +27,11 @@
const char* LISTENING = "Listening "; const char* LISTENING = "Listening ";
CHD44780::CHD44780(unsigned int rows, unsigned int cols, const std::vector<unsigned int>& pins) : CHD44780::CHD44780(unsigned int rows, unsigned int cols, const char* callsign, unsigned int dmrid, const std::vector<unsigned int>& pins) :
m_rows(rows), m_rows(rows),
m_cols(cols), m_cols(cols),
m_callsign(callsign),
m_dmrid(dmrid),
m_rb(pins.at(0U)), m_rb(pins.at(0U)),
m_strb(pins.at(1U)), m_strb(pins.at(1U)),
m_d0(pins.at(2U)), m_d0(pins.at(2U)),
@ -68,10 +70,10 @@ void CHD44780::setIdle()
::lcdClear(m_fd); ::lcdClear(m_fd);
::lcdPosition(m_fd, 0, 0); ::lcdPosition(m_fd, 0, 0);
::lcdPuts(m_fd, "MMDVM"); ::lcdPrintf(m_fd, "%-6s / %u", m_callsign, m_dmrid);
::lcdPosition(m_fd, 0, 1); ::lcdPosition(m_fd, 0, 1);
::lcdPuts(m_fd, "Idle"); ::lcdPuts(m_fd, "MMDVM Idle");
} }
void CHD44780::setError(const char* text) void CHD44780::setError(const char* text)

View file

@ -27,7 +27,7 @@
class CHD44780 : public IDisplay class CHD44780 : public IDisplay
{ {
public: public:
CHD44780(unsigned int rows, unsigned int cols, const std::vector<unsigned int>& pins); CHD44780(unsigned int rows, unsigned int cols, const char* callsign, unsigned int dmrid, const std::vector<unsigned int>& pins);
virtual ~CHD44780(); virtual ~CHD44780();
virtual bool open(); virtual bool open();
@ -54,6 +54,8 @@ public:
private: private:
unsigned int m_rows; unsigned int m_rows;
unsigned int m_cols; unsigned int m_cols;
const char* m_callsign;
unsigned int m_dmrid;
unsigned int m_rb; unsigned int m_rb;
unsigned int m_strb; unsigned int m_strb;
unsigned int m_d0; unsigned int m_d0;

View file

@ -567,6 +567,8 @@ void CMMDVMHost::readParams()
void CMMDVMHost::createDisplay() void CMMDVMHost::createDisplay()
{ {
std::string type = m_conf.getDisplay(); std::string type = m_conf.getDisplay();
std::string callsign = m_conf.getCallsign();
unsigned int dmrid = m_conf.getDMRId();
LogInfo("Display Parameters"); LogInfo("Display Parameters");
LogInfo(" Type: %s", type.c_str()); LogInfo(" Type: %s", type.c_str());
@ -598,7 +600,7 @@ void CMMDVMHost::createDisplay()
LogInfo(" Columns: %u", columns); LogInfo(" Columns: %u", columns);
LogInfo(" Pins: %u,%u,%u,%u,%u,%u", pins.at(0U), pins.at(1U), pins.at(2U), pins.at(3U), pins.at(4U), pins.at(5U)); LogInfo(" Pins: %u,%u,%u,%u,%u,%u", pins.at(0U), pins.at(1U), pins.at(2U), pins.at(3U), pins.at(4U), pins.at(5U));
m_display = new CHD44780(rows, columns, pins); m_display = new CHD44780(rows, columns, callsign.c_str(), dmrid, pins);
} }
#endif #endif
} else { } else {