View Single Post
Old 04-24-2012, 12:30 PM   #6
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by kiri87 View Post
I'm getting the with time() and localtime(). I'm not sure why the getmsec() function call was left in there. Initially I planned to update the clock every minute, so it won't affect the battery too much, thus, using sleep() wouldn't be that bad, even though it might be half a second off.
The angle of each hand is always calculated corectly, but sometimes the seconds line skips a beat (eg: 2 sleep(1)s that return after 1.5 seconds), so that's why sometimes the lines don't appear to be uniformly spaced.
I have updated to the latest gmlib, but it seems that "eips -g ./clockFrame2.png" no longer works. It flashes the image on screen, but after calling gmlib(GMLIB_UPDATE), it's replaced with an image from tmp/wb0. In my case, the last image from the hoser-2.0 demo https://www.mobileread.com/forums/sho...9&postcount=32 was displayed behind the clock.
I'll have to look into the screensaver disabling solution, when I have the time. These are the precious calls, correct?
Code:
lipc-set-prop com.lab126.powerd preventScreenSaver 1
killall -stop Xorg cvm # pause framework

killall -cont cvm Xorg # resume framework
lipc-set-prop com.lab126.powerd preventScreenSaver 0
In the new gmlib, the *real* framebuffer is /tmp/wb0, so after the "eips -g" call you need to copy each of the 600-byte wide lines from /dev/fb0 to /tmp/wb0. The display updates dither that across, so the result will be dithered. This new method was intended for high-speed animation, and will give you a dithered background.

So, until I add more features to gmlib (partial area dithers, etc.) perhaps you are better served by the old version.

Those calls look right. The Xorg process is only used for the K5(touch), but it does not hurt to try killing a non-existing process. The "lipc" commands control the screensaver, so you can use those. If you want to stop the framework from drawing crap on your clock, you may want to pause it too. But resume it at the end. They keyboard does not work when cvm paused, so you need to process keyboard events your self, either with a call to "waitforkey" (which pauses) or from directly from the input device.
geekmaster is offline   Reply With Quote