|
From: <mla...@us...> - 2006-11-20 10:40:42
|
Revision: 184
http://svn.sourceforge.net/g15daemon/?rev=184&view=rev
Author: mlampard
Date: 2006-11-20 02:40:41 -0800 (Mon, 20 Nov 2006)
Log Message:
-----------
move keyboard attach to foreground process, before we daemonise
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-20 02:08:28 UTC (rev 183)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-20 10:40:41 UTC (rev 184)
@@ -195,6 +195,7 @@
/* fps = 1000 / (g15daemon_gettime_ms() - lastscreentime); */
/* if the current screen is less than 20ms from the previous (equivelant to 50fps) delay it */
/* this allows a real-world fps of 40fps with no almost frame loss and reduces peak usb bus-load */
+
if((g15daemon_gettime_ms() - lastscreentime)>=20||(char*)displaying!=lastdisplayed){
uf_write_buf_to_g15(displaying);
lastscreentime = g15daemon_gettime_ms();
@@ -287,6 +288,13 @@
g15daemon_log(LOG_ERR,"G15Daemon already running.. Exiting");
exit(0);
}
+
+ /* init stuff here.. */
+ if((retval=initLibG15())==G15_ERROR_OPENING_USB_DEVICE){
+ g15daemon_log(LOG_ERR,"Unable to attach to the G15 Keyboard... exiting");
+ exit(1);
+ }
+
if(!g15daemon_debug)
daemon(0,0);
@@ -308,17 +316,10 @@
nobody = getpwuid(geteuid());
g15daemon_log(LOG_WARNING,"BEWARE: running as effective uid %i\n",nobody->pw_uid);
}
-
- /* init stuff here.. */
- retval = initLibG15();
+
setLCDContrast(1);
setLEDs(0);
- if(retval != G15_NO_ERROR){
- g15daemon_log(LOG_ERR,"Unable to find G15 keyboard or the keyboard is already handled. Exiting");
- goto exitnow;
- }
-
/* initialise the linked list */
lcdlist = ll_lcdlist_init();
lcdlist->nobody = nobody;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|