|
From: <mla...@us...> - 2006-11-15 01:57:07
|
Revision: 142
http://svn.sourceforge.net/g15daemon/?rev=142&view=rev
Author: mlampard
Date: 2006-11-14 17:57:07 -0800 (Tue, 14 Nov 2006)
Log Message:
-----------
discard excess frames to reduce load on the USB bus. reduces/resolves problem with missed keypresses.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-14 10:28:29 UTC (rev 141)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-15 01:57:07 UTC (rev 142)
@@ -172,7 +172,8 @@
lcdlist_t *displaylist = (lcdlist_t*)(lcdlist);
static long int lastlcd = 1;
-
+ static unsigned int lastscreentime;
+ unsigned int fps = 0;
lcd_t *displaying = displaylist->tail->lcd;
memset(displaying->buf,0,1024);
@@ -184,8 +185,14 @@
displaying = displaylist->current->lcd;
if(displaying->ident != lastlcd){
- uf_write_buf_to_g15(displaying);
- lastlcd = displaying->ident;
+ /* monitor 'fps' - due to the TCP protocol, some frames will be bunched up.
+ discard excess to reduce load on the bus - FIXME*/
+ fps = 1000 / (g15daemon_gettime_ms() - lastscreentime);
+ if(fps<50){ //peak fps rate - most plugins/clients will never come close
+ uf_write_buf_to_g15(displaying);
+ lastscreentime = g15daemon_gettime_ms();
+ }
+ lastlcd = displaying->ident;
}
if(displaying->state_changed ){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|