Allow for the configuration of the HD44780 pins.

This commit is contained in:
Jonathan Naylor
2016-04-06 17:43:20 +01:00
parent f7e2cff004
commit 3ee457830b
6 changed files with 42 additions and 7 deletions

View File

@@ -102,7 +102,8 @@ m_fusionNetworkDebug(false),
m_tftSerialPort(),
m_tftSerialBrightness(50U),
m_hd44780Rows(2U),
m_hd44780Columns(16U)
m_hd44780Columns(16U),
m_hd44780Pins()
{
}
@@ -300,6 +301,14 @@ bool CConf::read()
m_hd44780Rows = (unsigned int)::atoi(value);
else if (::strcmp(key, "Columns") == 0)
m_hd44780Columns = (unsigned int)::atoi(value);
else if (::strcmp(key, "Pins") == 0) {
char* p = ::strtok(value, ",\r\n");
while (p != NULL) {
unsigned int pin = (unsigned int)::atoi(p);
m_hd44780Pins.push_back(pin);
p = ::strtok(NULL, ",\r\n");
}
}
}
}
@@ -607,3 +616,8 @@ unsigned int CConf::getHD44780Columns() const
{
return m_hd44780Columns;
}
std::vector<unsigned int> CConf::getHD44780Pins() const
{
return m_hd44780Pins;
}