diff --git a/src/userinterface.cpp b/src/userinterface.cpp index 0fbf440..057dd8c 100644 --- a/src/userinterface.cpp +++ b/src/userinterface.cpp @@ -25,6 +25,8 @@ #include #include +#define I2C_MASTER_DEVICE (CMachineInfo::Get ()->GetDevice (DeviceI2CMaster)) + LOGMODULE ("ui"); CUserInterface::CUserInterface (CMiniDexed *pMiniDexed, CGPIOManager *pGPIOManager, CConfig *pConfig) @@ -52,6 +54,9 @@ bool CUserInterface::Initialize (void) if (m_pConfig->GetLCDEnabled ()) { + m_pI2CMaster = new CI2CMaster(I2C_MASTER_DEVICE); + m_pLCD = new CHD44780Device (&I2CMaster, CConfig::LCDI2CAddress, CConfig::LCDColumns, CConfig::LCDRows); + /* TODO: Read configuration file to see whether i2c should be used for the display. Otherwise run: m_pLCD = new CHD44780Device (CConfig::LCDColumns, CConfig::LCDRows, m_pConfig->GetLCDPinData4 (), m_pConfig->GetLCDPinData5 (), @@ -60,6 +65,7 @@ bool CUserInterface::Initialize (void) m_pConfig->GetLCDPinEnable (), m_pConfig->GetLCDPinRegisterSelect (), m_pConfig->GetLCDPinReadWrite ()); + */ assert (m_pLCD); if (!m_pLCD->Initialize ())