HD44780 PWM backlight control

This commit is contained in:
Tony Corbett
2016-05-01 16:59:43 +01:00
parent c54336c330
commit 414a1df408
6 changed files with 162 additions and 6 deletions

View File

@@ -568,9 +568,15 @@ void CMMDVMHost::readParams()
void CMMDVMHost::createDisplay()
{
std::string type = m_conf.getDisplay();
std::string callsign = m_conf.getCallsign();
unsigned int dmrid = m_conf.getDMRId();
std::string type = m_conf.getDisplay();
std::string callsign = m_conf.getCallsign();
unsigned int dmrid = m_conf.getDMRId();
// WFV
unsigned int PWM = m_conf.getHD44780PWM();
unsigned int PWMPin = m_conf.getHD44780PWMPin();
unsigned int PWMBright = m_conf.getHD44780PWMBright();
unsigned int PWMDim = m_conf.getHD44780PWMDim();
LogInfo("Display Parameters");
LogInfo(" Type: %s", type.c_str());
@@ -604,7 +610,15 @@ 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, dmrid, pins);
// WFV
if (PWM == 1U) {
LogInfo("PWM Brightness Control Enabled");
LogInfo(" PWM Pin: %u", PWMPin);
LogInfo(" PWM Bright: %u", PWMBright);
LogInfo(" PWM Dim: %u", PWMDim);
}
m_display = new CHD44780(rows, columns, callsign, dmrid, pins, PWM, PWMPin, PWMBright, PWMDim);
}
#endif
} else {