From a83e3120328d2d0ccbd1fef1db9befac0fd7ad3f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 13 Nov 2019 01:15:25 +0100 Subject: [PATCH] simple_display: fix dim setting Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8a5a269e4b1b04a1af949524ad60760779849828 Author: vanhofen Date: 2019-11-13 (Wed, 13 Nov 2019) Origin message was: ------------------ - simple_display: fix dim setting ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/simple_display.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/driver/simple_display.cpp b/src/driver/simple_display.cpp index 0b5ba072a..4d0dabdcb 100644 --- a/src/driver/simple_display.cpp +++ b/src/driver/simple_display.cpp @@ -120,9 +120,12 @@ static void replace_umlauts(std::string &s) CLCD::CLCD() { /* do not show menu in neutrino...,at Line Display true, because there is th GLCD Menu */ - if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) + if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT || g_info.hw_caps->display_type == HW_DISPLAY_LED_ONLY) { - has_lcd = true; + if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) + has_lcd = true; + else + has_lcd = false; mode = MODE_TVRADIO; switch_name_time_cnt = 0; timeout_cnt = 0; @@ -174,16 +177,21 @@ void CLCD::wake_up() void* CLCD::TimeThread(void *) { set_threadname("n:boxdisplay"); /* to not confuse with TV display */ - while (CLCD::getInstance()->thread_running) { + while (CLCD::getInstance()->thread_running) + { sleep(1); - if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) { + if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT || g_info.hw_caps->display_type == HW_DISPLAY_LED_ONLY) + { struct stat buf; - if (stat("/tmp/vfd.locked", &buf) == -1) { + if (stat("/tmp/vfd.locked", &buf) == -1) + { CLCD::getInstance()->showTime(); CLCD::getInstance()->count_down(); - } else + } + else CLCD::getInstance()->wake_up(); - } else + } + else CLCD::getInstance()->showTime(); #if 0 /* hack, just if we missed the blit() somewhere @@ -507,7 +515,8 @@ void CLCD::setMode(const MODES m, const char * const title) showTime(); } #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE - wake_up(); + if (m != MODE_SHUTDOWN && m != MODE_STANDBY) + wake_up(); #endif } @@ -662,10 +671,12 @@ void CLCD::pause() void CLCD::Lock() { + creat("/tmp/vfd.locked", 0); } void CLCD::Unlock() { + unlink("/tmp/vfd.locked"); } #if HAVE_SPARK_HARDWARE