|
From: <mla...@us...> - 2006-12-16 14:33:11
|
Revision: 204
http://svn.sourceforge.net/g15daemon/?rev=204&view=rev
Author: mlampard
Date: 2006-12-16 06:33:11 -0800 (Sat, 16 Dec 2006)
Log Message:
-----------
add ability to reinitialise keyboard if it was unplugged while g15daemon was running. requires libg15 1.2.0 or svn
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-12-16 14:20:36 UTC (rev 203)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-12-16 14:33:11 UTC (rev 204)
@@ -172,9 +172,15 @@
g15daemon_send_event(masterlist->current->lcd,
G15_EVENT_KEYPRESS, keypresses);
}
- if(retval == G15_ERROR_READING_USB_DEVICE){
- //g15daemon_log(LOG_WARNING,"Error reading the keyboard");
+ if(retval == -ENODEV && LIBG15_VERSION>=1200) {
+ pthread_mutex_lock(&g15lib_mutex);
+ while((retval=re_initLibG15() != G15_NO_ERROR) && !leaving){
+ sleep(1);
+ }
+ if(!leaving) { masterlist->current->lcd->state_changed=1; masterlist->current->lcd->ident=random();}
+ pthread_mutex_unlock(&g15lib_mutex);
}
+
g15daemon_msleep(10);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|