diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp index f6934006f..e265ace0c 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -296,6 +296,8 @@ void CLCD4l::Init() if (!access(LCD_DATADIR, F_OK) == 0) mkdir(LCD_DATADIR, 0755); + + wait4lcd = true; } void* CLCD4l::LCD4lProc(void* arg) @@ -320,9 +322,13 @@ void* CLCD4l::LCD4lProc(void* arg) { if (g_settings.lcd4l_support == 1) // automatic { - //printf("[CLCD4l] %s: waiting for lcd4linux\n", __FUNCTION__); - sleep(10); - continue; + if (PLCD4l->GetWaitStatus()) { + //printf("[CLCD4l] %s: waiting for lcd4linux\n", __FUNCTION__); + sleep(10); + continue; + } + else + PLCD4l->SetWaitStatus(true); } } diff --git a/src/driver/lcd4l.h b/src/driver/lcd4l.h index cc49c55a2..2d04587ae 100644 --- a/src/driver/lcd4l.h +++ b/src/driver/lcd4l.h @@ -56,6 +56,7 @@ class CLCD4l void StartLCD4l(); void StopLCD4l(); void SwitchLCD4l(); + void ForceRun() { wait4lcd = false; } int CreateFile(const char *file, std::string content = "", bool convert = false); int RemoveFile(const char *file); @@ -69,6 +70,7 @@ class CLCD4l static void* LCD4lProc(void *arg); struct tm *tm_struct; + bool wait4lcd; // Functions void Init(); @@ -82,6 +84,9 @@ class CLCD4l void strReplace(std::string &orig, const std::string &fstr, const std::string &rstr); bool WriteFile(const char *file, std::string content = "", bool convert = false); + void SetWaitStatus(bool wait) { wait4lcd = wait; } + bool GetWaitStatus() { return wait4lcd; } + // Variables uint64_t m_ParseID; int m_Mode; diff --git a/src/gui/lcd4l_setup.cpp b/src/gui/lcd4l_setup.cpp index 061745614..e06e0638a 100644 --- a/src/gui/lcd4l_setup.cpp +++ b/src/gui/lcd4l_setup.cpp @@ -242,6 +242,9 @@ int CLCD4lSetup::show() if (initlcd4l) LCD4l->InitLCD4l(); + if (g_settings.lcd4l_support == 1 ) // automatic + LCD4l->ForceRun(); + return res; }