mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
make driver selectable for graphlcd
Origin commit data
------------------
Branch: ni/coolstream
Commit: cd00832423
Author: TangoCash <eric@loxat.de>
Date: 2019-12-29 (Sun, 29 Dec 2019)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -562,7 +562,11 @@ void nGLCD::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");
|
||||
@@ -959,3 +963,14 @@ int nGLCD::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t /* data */)
|
||||
return messages_return::unhandled;
|
||||
}
|
||||
|
||||
int nGLCD::GetConfigSize()
|
||||
{
|
||||
return (int) GLCD::Config.driverConfigs.size();
|
||||
}
|
||||
|
||||
std::string nGLCD::GetConfigName(int driver)
|
||||
{
|
||||
if ((driver < 0) || (driver > GetConfigSize() - 1))
|
||||
driver = 0;
|
||||
return GLCD::Config.driverConfigs[driver].name;
|
||||
}
|
||||
|
@@ -130,6 +130,8 @@ class nGLCD
|
||||
static void Exit();
|
||||
static void Blit();
|
||||
static void SetBrightness(unsigned int b);
|
||||
int GetConfigSize();
|
||||
std::string GetConfigName(int);
|
||||
void UpdateBrightness();
|
||||
int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data);
|
||||
};
|
||||
|
Reference in New Issue
Block a user