mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
- glcd: re-add driver selection
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -786,7 +786,11 @@ void cGLCD::Run(void)
|
||||
break;
|
||||
|
||||
int warmUp = 10;
|
||||
lcd = GLCD::CreateDriver(GLCD::Config.driverConfigs[0].id, &GLCD::Config.driverConfigs[0]);
|
||||
|
||||
if ((g_settings.glcd_selected_config < 0) || (g_settings.glcd_selected_config > GetConfigSize() - 1))
|
||||
g_settings.glcd_selected_config = 0;
|
||||
|
||||
lcd = GLCD::CreateDriver(GLCD::Config.driverConfigs[g_settings.glcd_selected_config].id, &GLCD::Config.driverConfigs[g_settings.glcd_selected_config]);
|
||||
if (!lcd) {
|
||||
#ifdef GLCD_DEBUG
|
||||
fprintf(stderr, "CreateDriver failed.\n");
|
||||
@@ -1705,3 +1709,14 @@ int cGLCD::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t /* data */)
|
||||
return messages_return::unhandled;
|
||||
}
|
||||
|
||||
int cGLCD::GetConfigSize()
|
||||
{
|
||||
return (int) GLCD::Config.driverConfigs.size();
|
||||
}
|
||||
|
||||
std::string cGLCD::GetConfigName(int driver)
|
||||
{
|
||||
if ((driver < 0) || (driver > GetConfigSize() - 1))
|
||||
driver = 0;
|
||||
return GLCD::Config.driverConfigs[driver].name;
|
||||
}
|
||||
|
Reference in New Issue
Block a user