From 366751e85a88bb4c05c6b5bd4ff9502a73092d27 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 1 Apr 2012 13:02:59 +0200 Subject: [PATCH] spark: blit framebuffer once per second Just for the case that some code has not yet added the correct fb->blit() calls, call it once per second to make sure that stuff appears on the display. If you find menus or stuff which is lagging heavily, they are probably missing those blit() calls. Of course this has nothing to do with the LED display code, but putting it there saves us from using yet another thread. --- src/driver/spark_led.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/driver/spark_led.cpp b/src/driver/spark_led.cpp index de54ae302..e7e5144ee 100644 --- a/src/driver/spark_led.cpp +++ b/src/driver/spark_led.cpp @@ -25,6 +25,7 @@ #endif #include +#include #include #include @@ -86,6 +87,10 @@ void* CLCD::TimeThread(void *) while(1) { sleep(1); CLCD::getInstance()->showTime(); + /* hack, just if we missed the blit() somewhere + * this will update the framebuffer once per second */ + if (getenv("SPARK_NOBLIT") == NULL) + CFrameBuffer::getInstance()->blit(); } return NULL; }