From 8a5b2241f50ec0210f40e3aa08b23f8caaff1924 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 1 Apr 2012 14:30:33 +0200 Subject: [PATCH] spark: also show menu texts on LED display Even though this is hard to read, it might still allow to navigate blind in case e.g. videosettings are wrong. --- src/driver/spark_led.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/driver/spark_led.cpp b/src/driver/spark_led.cpp index e7e5144ee..d66aea71b 100644 --- a/src/driver/spark_led.cpp +++ b/src/driver/spark_led.cpp @@ -55,13 +55,20 @@ static inline int dev_open() static void display(const char *s, bool update_timestamp = true) { int fd = dev_open(); + int len = strlen(s); if (fd < 0) return; printf("spark_led:%s '%s'\n", __func__, s); - write(fd, s, strlen(s)); + write(fd, s, len); close(fd); if (update_timestamp) + { last_display = time(NULL); + /* increase timeout to ensure that everything is displayed + * the driver displays 5 characters per second */ + if (len > 4) + last_display += (len - 4) / 5; + } } CLCD::CLCD() @@ -203,11 +210,11 @@ void CLCD::showPercentOver(const unsigned char perc, const bool /*perform_update { } -void CLCD::showMenuText(const int, const char *, const int, const bool) +void CLCD::showMenuText(const int, const char *text, const int, const bool) { if (mode != MODE_MENU_UTF8) return; -// ShowText(ptext); + display(text); } void CLCD::showAudioTrack(const std::string &, const std::string & title, const std::string &)