diff --git a/HD44780.cpp b/HD44780.cpp index 07bbf87..dcd55dd 100644 --- a/HD44780.cpp +++ b/HD44780.cpp @@ -28,7 +28,7 @@ const char* LISTENING = "Listening "; -CHD44780::CHD44780(unsigned int rows, unsigned int cols, const char* callsign, unsigned int dmrid, const std::vector& pins) : +CHD44780::CHD44780(unsigned int rows, unsigned int cols, const std::string& callsign, unsigned int dmrid, const std::vector& pins) : m_rows(rows), m_cols(cols), m_callsign(callsign), @@ -44,7 +44,7 @@ m_dmr(false) { assert(rows > 1U); assert(cols > 15U); - assert(callsign != NULL); + assert(callsign.c_str() != NULL); } CHD44780::~CHD44780() @@ -93,7 +93,7 @@ void CHD44780::setIdle() ::lcdClear(m_fd); ::lcdPosition(m_fd, 0, 0); - ::lcdPrintf(m_fd, "%-6s / %u", m_callsign, m_dmrid); + ::lcdPrintf(m_fd, "%-6s / %u", m_callsign.c_str(), m_dmrid); ::lcdPosition(m_fd, 0, 1); ::lcdPuts(m_fd, "MMDVM Idle"); diff --git a/HD44780.h b/HD44780.h index acce49b..1815088 100644 --- a/HD44780.h +++ b/HD44780.h @@ -37,7 +37,7 @@ class CHD44780 : public IDisplay { public: - CHD44780(unsigned int rows, unsigned int cols, const char* callsign, unsigned int dmrid, const std::vector& pins); + CHD44780(unsigned int rows, unsigned int cols, const std::string& callsign, unsigned int dmrid, const std::vector& pins); virtual ~CHD44780(); virtual bool open(); @@ -61,7 +61,7 @@ public: private: unsigned int m_rows; unsigned int m_cols; - const char* m_callsign; + std::string m_callsign; unsigned int m_dmrid; unsigned int m_rb; unsigned int m_strb; diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 7d97f54..bd4a47b 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -602,7 +602,7 @@ void CMMDVMHost::createDisplay() 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)); - m_display = new CHD44780(rows, columns, callsign.c_str(), dmrid, pins); + m_display = new CHD44780(rows, columns, callsign, dmrid, pins); } #endif } else {