From: Martin Z. <co...@mz...> - 2010-02-01 17:57:01
|
Hi! I had a long train ride today and, after staring at the beautiful, snow-filled landscape for hours, had a go at synchronising widget updates. I won't commit this to SVN before I have the all-go, though, as I don't know whether my patch might introduce a lag on some LCD updates and whether you actually want synchronised widgets. That being said, the patch works flawless on the X display driver and my picoLCD 256x64. Here's what I did: I basically duplicated "timer.c" and "timer.h". I also changed all the widgets to call "timer_add_widget()" instead of "timer_add()". This function stores all the necessary callback data and allocates a new timer -- but only one timer for each update interval. This timer then regularly calls "timer_process_group()", which processes all widgets with the given update data. This not only synchronises widgets, but also gets rid of a lot of unessesary timers. Simple, but quite effective. If you wish to, please run "lcd4linux" with the attached configuration file "synchronise.conf". You will see a lot of icons that pop up and vanish rather irregularly. After applying my patch, all boxes of a given update interval appear at once and vanish in the same way. By the way, I added "timer_group.c" and "timer_group.h" to "Makefile.am", ran "./bootstrap", "./configure" and "make". I hope that this was the correct thing to do -- I have never used "automake" before... ;) Best regards, Martin -- www.mzuther.de www.radix-musik.de |