|
From: <mla...@us...> - 2006-11-11 11:09:30
|
Revision: 107
http://svn.sourceforge.net/g15daemon/?rev=107&view=rev
Author: mlampard
Date: 2006-11-11 03:09:24 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
I can no longer notice deadlocks, drop sleep time in the display thread to 5milliseconds.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-11 11:06:33 UTC (rev 106)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-11 11:09:24 UTC (rev 107)
@@ -154,7 +154,7 @@
static long int lastlcd = 1;
lcd_t *displaying = displaylist->tail->lcd;
- memset(displaying->buf,0,1024);
+ memset(displaying->buf,0,1024);
writePixmapToLCD(logo_data);
pthread_sleep(2);
@@ -162,7 +162,7 @@
while (!leaving) {
pthread_mutex_lock(&lcdlist_mutex);
- displaying = displaylist->current->lcd;
+ displaying = displaylist->current->lcd;
if(displaylist->tail == displaylist->current){
internal_lcdclock(displaying);
@@ -183,7 +183,7 @@
pthread_mutex_unlock(&lcdlist_mutex);
- pthread_msleep(100);
+ pthread_msleep(5);
}
return NULL;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2006-11-11 15:39:49
|
Revision: 113
http://svn.sourceforge.net/g15daemon/?rev=113&view=rev
Author: mlampard
Date: 2006-11-11 07:39:44 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
when faking the cycle-key keypress, ensure the keydown event is sent.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-11 15:24:37 UTC (rev 112)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-11 15:39:44 UTC (rev 113)
@@ -80,7 +80,7 @@
lcd_t *lcd = (lcd_t*)caller;
lcdlist_t* displaylist = lcd->masterlist;
static unsigned int clicktime;
- if(value == cycle_key) {
+ if(value & cycle_key) {
clicktime=gettimerms();
}else{
unsigned int unclick=gettimerms();
@@ -92,9 +92,13 @@
plugin_event_t *clickevent=malloc(sizeof(plugin_event_t));
int *(*plugin_listener)(plugin_event_t *clickevent) = (void*)lcd->g15plugin->info->event_handler;
clickevent->event = event;
- clickevent->value = value;
+ clickevent->value = value|cycle_key;
clickevent->lcd = lcd;
(*plugin_listener)((void*)clickevent);
+ clickevent->event = event;
+ clickevent->value = value&~cycle_key;
+ clickevent->lcd = lcd;
+ (*plugin_listener)((void*)clickevent);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <mla...@us...> - 2006-11-15 02:47:27
|
Revision: 143
http://svn.sourceforge.net/g15daemon/?rev=143&view=rev
Author: mlampard
Date: 2006-11-14 18:47:27 -0800 (Tue, 14 Nov 2006)
Log Message:
-----------
ensure that newly switched screens are displayed instantly
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-15 01:57:07 UTC (rev 142)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-15 02:47:27 UTC (rev 143)
@@ -175,6 +175,7 @@
static unsigned int lastscreentime;
unsigned int fps = 0;
lcd_t *displaying = displaylist->tail->lcd;
+ lcd_t *lastdisplayed=NULL;
memset(displaying->buf,0,1024);
g15daemon_sleep(2);
@@ -188,9 +189,10 @@
/* 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
+ if(fps<50||displaying!=lastdisplayed){ //peak fps rate - most plugins/clients will never come close
uf_write_buf_to_g15(displaying);
lastscreentime = g15daemon_gettime_ms();
+ lastdisplayed = displaying;
}
lastlcd = displaying->ident;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2006-11-16 08:24:08
|
Revision: 158
http://svn.sourceforge.net/g15daemon/?rev=158&view=rev
Author: mlampard
Date: 2006-11-16 00:24:08 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
have the display thread temporally space frames evenly if they're too close
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-16 04:12:39 UTC (rev 157)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-16 08:24:08 UTC (rev 158)
@@ -174,7 +174,7 @@
lcdlist_t *displaylist = (lcdlist_t*)(lcdlist);
static long int lastlcd = 1;
static unsigned int lastscreentime;
- unsigned int fps = 0;
+ /* unsigned int fps = 0; */
lcd_t *displaying = displaylist->tail->lcd;
lcd_t *lastdisplayed=NULL;
memset(displaying->buf,0,1024);
@@ -188,14 +188,16 @@
if(displaying->ident != lastlcd){
/* 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||displaying!=lastdisplayed){ //peak fps rate - most plugins/clients will never come close
+ discard excess to reduce load on the bus */
+ /* 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||displaying!=lastdisplayed){
uf_write_buf_to_g15(displaying);
lastscreentime = g15daemon_gettime_ms();
lastdisplayed = displaying;
+ lastlcd = displaying->ident;
}
- 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.
|
|
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.
|
|
From: <mla...@us...> - 2006-11-21 16:13:38
|
Revision: 189
http://svn.sourceforge.net/g15daemon/?rev=189&view=rev
Author: mlampard
Date: 2006-11-21 08:13:35 -0800 (Tue, 21 Nov 2006)
Log Message:
-----------
add mutexs around all libg15 access, and improve keyboard handling
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-21 16:10:15 UTC (rev 188)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-21 16:13:35 UTC (rev 189)
@@ -155,17 +155,26 @@
unsigned int keypresses = 0;
int retval = 0;
-
while (!leaving) {
pthread_mutex_lock(&g15lib_mutex);
retval = getPressedKeys(&keypresses, 40);
pthread_mutex_unlock(&g15lib_mutex);
+ /* every 2nd packet contains the codes we want.. immediately try again */
+ while (retval == G15_ERROR_TRY_AGAIN){
+ pthread_mutex_lock(&g15lib_mutex);
+ retval = getPressedKeys(&keypresses, 40);
+ pthread_mutex_unlock(&g15lib_mutex);
+ }
+
if(retval == G15_NO_ERROR){
g15daemon_send_event(masterlist->current->lcd,
- G15_EVENT_KEYPRESS, keypresses);
+ G15_EVENT_KEYPRESS, keypresses);
}
+ if(retval == G15_ERROR_READING_USB_DEVICE){
+ //g15daemon_log(LOG_WARNING,"Error reading the keyboard");
+ }
g15daemon_msleep(10);
}
@@ -205,9 +214,11 @@
}
if(displaying->state_changed ){
+ pthread_mutex_lock(&g15lib_mutex);
setLCDContrast(displaying->contrast_state);
setLEDs(displaying->mkey_state);
setLCDBrightness(displaying->backlight_state);
+ pthread_mutex_unlock(&g15lib_mutex);
displaying->state_changed = 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2006-11-21 16:32:37
|
Revision: 191
http://svn.sourceforge.net/g15daemon/?rev=191&view=rev
Author: mlampard
Date: 2006-11-21 08:32:31 -0800 (Tue, 21 Nov 2006)
Log Message:
-----------
add configitem for cycle key. cmdline will still override if used
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-21 16:31:03 UTC (rev 190)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-21 16:32:31 UTC (rev 191)
@@ -246,6 +246,7 @@
pid_t daemonpid;
int retval;
int i;
+ int cycle_cmdline_override=0;
struct sigaction new_action;
cycle_key = G15_KEY_MR;
unsigned char user[256];
@@ -281,6 +282,7 @@
if (!strncmp(daemonargs, "-s",2) || !strncmp(daemonargs, "--switch",8)) {
cycle_key = G15_KEY_L1;
+ cycle_cmdline_override=1;
}
if (!strncmp(daemonargs, "-d",2) || !strncmp(daemonargs, "--debug",7)) {
@@ -312,6 +314,7 @@
if(uf_create_pidfile() == 0) {
g15daemon_t *lcdlist;
+ config_section_t *global_cfg=NULL;
pthread_attr_t attr;
struct passwd *nobody;
unsigned char location[1024];
@@ -336,7 +339,11 @@
lcdlist->nobody = nobody;
uf_conf_open(lcdlist, "/etc/g15daemon.conf");
- /* all other processes/threads should be seteuid nobody */
+ global_cfg=g15daemon_cfg_load_section(lcdlist,"Global");
+ if(!cycle_cmdline_override){
+ cycle_key = 1==g15daemon_cfg_read_bool(global_cfg,"Use MR as Cycle Key",0)?G15_KEY_MR:G15_KEY_L1;
+ }
+ /* all other processes/threads should be seteuid nobody */
if(nobody!=NULL) {
seteuid(nobody->pw_uid);
setegid(nobody->pw_gid);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2006-11-21 16:44:38
|
Revision: 192
http://svn.sourceforge.net/g15daemon/?rev=192&view=rev
Author: mlampard
Date: 2006-11-21 08:44:36 -0800 (Tue, 21 Nov 2006)
Log Message:
-----------
make default cycle key L1 --switch(or config option) will now revert to MR
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-21 16:32:31 UTC (rev 191)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-21 16:44:36 UTC (rev 192)
@@ -248,7 +248,7 @@
int i;
int cycle_cmdline_override=0;
struct sigaction new_action;
- cycle_key = G15_KEY_MR;
+ cycle_key = G15_KEY_L1;
unsigned char user[256];
pthread_t keyboard_thread;
@@ -281,7 +281,7 @@
}
if (!strncmp(daemonargs, "-s",2) || !strncmp(daemonargs, "--switch",8)) {
- cycle_key = G15_KEY_L1;
+ cycle_key = G15_KEY_MR;
cycle_cmdline_override=1;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2006-12-16 04:38:21
|
Revision: 200
http://svn.sourceforge.net/g15daemon/?rev=200&view=rev
Author: mlampard
Date: 2006-12-15 20:38:21 -0800 (Fri, 15 Dec 2006)
Log Message:
-----------
add libg15v1.2 debugging, and switch off backlight on exit
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-12-16 04:18:36 UTC (rev 199)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-12-16 04:38:21 UTC (rev 200)
@@ -301,6 +301,10 @@
g15daemon_log(LOG_ERR,"G15Daemon already running.. Exiting");
exit(0);
}
+
+ /* set libg15 debugging to our debug setting */
+ if(LIBG15_VERSION>=1200)
+ libg15Debug(g15daemon_debug);
/* init stuff here.. */
if((retval=initLibG15())==G15_ERROR_OPENING_USB_DEVICE){
@@ -333,6 +337,7 @@
setLCDContrast(1);
setLEDs(0);
+ setLCDBrightness(1);
/* initialise the linked list */
lcdlist = ll_lcdlist_init();
@@ -400,7 +405,8 @@
pthread_join(lcd_thread,NULL);
pthread_join(keyboard_thread,NULL);
-
+ /* switch off the lcd backlight */
+ setLCDBrightness(0);
#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1100
exitLibG15();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <mla...@us...> - 2006-12-16 14:39:29
|
Revision: 205
http://svn.sourceforge.net/g15daemon/?rev=205&view=rev
Author: mlampard
Date: 2006-12-16 06:39:28 -0800 (Sat, 16 Dec 2006)
Log Message:
-----------
add extra debugging functionality available in 1.2
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:33:11 UTC (rev 204)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-12-16 14:39:28 UTC (rev 205)
@@ -36,6 +36,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <pwd.h>
+#include <ctype.h>
#include <config.h>
#include <libg15.h>
@@ -293,6 +294,11 @@
if (!strncmp(daemonargs, "-d",2) || !strncmp(daemonargs, "--debug",7)) {
g15daemon_debug = 1;
+ if((argv[i+1])!=NULL)
+ if(isdigit(argv[i+1][0])){
+ g15daemon_debug = atoi(argv[i+1]);
+ if(g15daemon_debug==0) g15daemon_debug = 1;
+ }
}
if (!strncmp(daemonargs, "-u",2) || !strncmp(daemonargs, "--user",7)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2006-12-17 08:50:27
|
Revision: 206
http://svn.sourceforge.net/g15daemon/?rev=206&view=rev
Author: mlampard
Date: 2006-12-17 00:50:27 -0800 (Sun, 17 Dec 2006)
Log Message:
-----------
add option to turn off keyboard backlight on exit, hopefully this will help users who have power on the usb bus when the pc is shutdown. Using uppercase -K or -KILL on the cmdline will activate. requires libg15 1.2 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:39:28 UTC (rev 205)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-12-17 08:50:27 UTC (rev 206)
@@ -49,6 +49,7 @@
/* all threads will exit if leaving >0 */
int leaving = 0;
+int keyboard_backlight_off_onexit = 0;
unsigned int g15daemon_debug = 0;
unsigned int cycle_key;
unsigned int client_handles_keys = 0;
@@ -238,6 +239,8 @@
void g15daemon_sighandler(int sig) {
switch(sig){
+ case SIGUSR1:
+ keyboard_backlight_off_onexit = 1;
case SIGINT:
case SIGQUIT:
leaving = 1;
@@ -274,6 +277,14 @@
printf("G15Daemon not running\n");
exit(0);
}
+ if (!strncmp(daemonargs, "-K",2) || !strncmp(daemonargs, "--KILL",6)) {
+ daemonpid = uf_return_running();
+ if(daemonpid>0) {
+ kill(daemonpid,SIGUSR1);
+ } else
+ printf("G15Daemon not running\n");
+ exit(0);
+ }
if (!strncmp(daemonargs, "-v",2) || !strncmp(daemonargs, "--version",9)) {
float lg15ver = LIBG15_VERSION;
printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running");
@@ -283,7 +294,13 @@
if (!strncmp(daemonargs, "-h",2) || !strncmp(daemonargs, "--help",6)) {
printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running");
- printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) or -v (--version)\n\n -k will kill a previous incarnation,\n -h shows this help\n -s changes the screen-switch key from MR to L1\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n",argv[0]);
+ printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) or -v (--version)\n\n -k will kill a previous incarnation",argv[0]);
+ #ifdef LIBG15_VERSION
+ #if LIBG15_VERSION >= 1200
+ printf(", if uppercase -K or -KILL turn off the keyboard backlight on the way out.");
+ #endif
+ #endif
+ printf("\n -h shows this help\n -s changes the screen-switch key from MR to L1\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n");
exit(0);
}
@@ -319,11 +336,11 @@
libg15Debug(g15daemon_debug);
/* init stuff here.. */
- if((retval=initLibG15())==G15_ERROR_OPENING_USB_DEVICE){
+ if((retval=initLibG15())!=G15_NO_ERROR){
g15daemon_log(LOG_ERR,"Unable to attach to the G15 Keyboard... exiting");
exit(1);
}
-
+
if(!g15daemon_debug)
daemon(0,0);
@@ -350,7 +367,12 @@
setLCDContrast(1);
setLEDs(0);
setLCDBrightness(1);
-
+
+#ifdef LIBG15_VERSION
+#if LIBG15_VERSION >= 1200
+ setKBBrightness(1);
+#endif
+#endif
/* initialise the linked list */
lcdlist = ll_lcdlist_init();
lcdlist->nobody = nobody;
@@ -407,6 +429,7 @@
new_action.sa_flags = 0;
sigaction(SIGINT, &new_action, NULL);
sigaction(SIGQUIT, &new_action, NULL);
+ sigaction(SIGUSR1, &new_action, NULL);
do {
sleep(1);
@@ -420,6 +443,14 @@
/* switch off the lcd backlight */
setLCDBrightness(0);
#ifdef LIBG15_VERSION
+#if LIBG15_VERSION >= 1200
+ /* if SIGUSR1 was sent to kill us, switch off the keyboard backlight as well */
+ if(keyboard_backlight_off_onexit==1)
+ setKBBrightness(0);
+#endif
+#endif
+
+#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1100
exitLibG15();
#endif
@@ -427,8 +458,8 @@
ll_lcdlist_destroy(&lcdlist);
exitnow:
- /* return to root privilages for the final countdown */
- seteuid(0);
+ /* return to root privilages for the final countdown */
+ seteuid(0);
setegid(0);
closelog();
uf_conf_write(lcdlist,"/etc/g15daemon.conf");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rob...@us...> - 2007-09-09 15:04:33
|
Revision: 296
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=296&view=rev
Author: robynhub
Date: 2007-09-09 08:04:36 -0700 (Sun, 09 Sep 2007)
Log Message:
-----------
erroneus function fix
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-09-09 04:37:50 UTC (rev 295)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-09-09 15:04:36 UTC (rev 296)
@@ -359,7 +359,7 @@
exit(1);
}
} else {
- daemon_log(LOG_ERR,"Unable to launch kextload...exiting");
+ g15daemon_log(LOG_ERR,"Unable to launch kextload...exiting");
exit(1);
}
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2007-09-10 07:57:49
|
Revision: 302
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=302&view=rev
Author: mlampard
Date: 2007-09-10 00:57:53 -0700 (Mon, 10 Sep 2007)
Log Message:
-----------
fix compiler warning
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-09-10 07:55:15 UTC (rev 301)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-09-10 07:57:53 UTC (rev 302)
@@ -31,6 +31,7 @@
#include <errno.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2007-11-23 04:18:55
|
Revision: 320
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=320&view=rev
Author: mlampard
Date: 2007-11-22 20:19:00 -0800 (Thu, 22 Nov 2007)
Log Message:
-----------
run all threads with default scheduling
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-11-19 05:37:36 UTC (rev 319)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-11-23 04:19:00 UTC (rev 320)
@@ -422,19 +422,12 @@
pthread_mutex_init(&g15lib_mutex, NULL);
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr,512*1024); /* set stack to 512k - dont need 8Mb !! */
- pthread_attr_setscope(&attr,PTHREAD_SCOPE_SYSTEM);
- int thread_policy=SCHED_RR;
- pthread_attr_setschedpolicy(&attr,thread_policy);
if (pthread_create(&keyboard_thread, &attr, keyboard_watch_thread, lcdlist) != 0) {
g15daemon_log(LOG_ERR,"Unable to create keyboard listener thread. Exiting");
goto exitnow;
}
pthread_attr_setstacksize(&attr,128*1024);
- /* all other threads have a lower priority... maybe */
- pthread_attr_setscope(&attr,PTHREAD_SCOPE_PROCESS);
- thread_policy=SCHED_OTHER;
- pthread_attr_setschedpolicy(&attr,thread_policy);
if (pthread_create(&lcd_thread, &attr, lcd_draw_thread, lcdlist) != 0) {
g15daemon_log(LOG_ERR,"Unable to create display thread. Exiting");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2007-11-29 01:41:44
|
Revision: 323
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=323&view=rev
Author: mlampard
Date: 2007-11-28 17:37:10 -0800 (Wed, 28 Nov 2007)
Log Message:
-----------
fix backlight issues on lcd_cycle() with new G15. Thanks Adam.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-11-29 00:04:29 UTC (rev 322)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-11-29 01:37:10 UTC (rev 323)
@@ -84,7 +84,10 @@
if(value & G15_KEY_LIGHT){ // the backlight key was pressed - maintain user-selected state
lcd->masterlist->kb_backlight_state++;
if(lcd->masterlist->kb_backlight_state>2)
+ lcd_t *displaying = lcd->masterlist->tail->lcd;
lcd->masterlist->kb_backlight_state=0;
+ displaying->backlight_state++;
+ displaying->backlight_state %= 3; // limit to 0-2 inclusive
}
free(newevent);
}else{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2007-12-02 01:32:25
|
Revision: 332
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=332&view=rev
Author: mlampard
Date: 2007-12-01 17:32:29 -0800 (Sat, 01 Dec 2007)
Log Message:
-----------
catch SIGTERM and exit nicely.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-12-02 00:48:22 UTC (rev 331)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-12-02 01:32:29 UTC (rev 332)
@@ -260,6 +260,7 @@
case SIGUSR1:
keyboard_backlight_off_onexit = 1;
case SIGINT:
+ case SIGTERM:
case SIGQUIT:
leaving = 1;
break;
@@ -457,6 +458,7 @@
new_action.sa_flags = 0;
sigaction(SIGINT, &new_action, NULL);
sigaction(SIGQUIT, &new_action, NULL);
+ sigaction(SIGTERM, &new_action, NULL);
sigaction(SIGUSR1, &new_action, NULL);
do {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2007-12-18 05:24:33
|
Revision: 342
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=342&view=rev
Author: mlampard
Date: 2007-12-17 21:24:37 -0800 (Mon, 17 Dec 2007)
Log Message:
-----------
Blank LCD on exit.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-12-18 05:24:15 UTC (rev 341)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-12-18 05:24:37 UTC (rev 342)
@@ -479,6 +479,10 @@
pthread_join(lcd_thread,NULL);
pthread_join(keyboard_thread,NULL);
/* switch off the lcd backlight */
+ char *blank=malloc(G15_BUFFER_LEN);
+ memset(blank,0,G15_BUFFER_LEN);
+ uf_write_buf_to_g15(blank);
+ free(blank);
setLCDBrightness(0);
#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2007-12-18 05:36:39
|
Revision: 344
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=344&view=rev
Author: mlampard
Date: 2007-12-17 21:36:44 -0800 (Mon, 17 Dec 2007)
Log Message:
-----------
Fix previous commit. Add --lcdlevel option to set default LCD brightness.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-12-18 05:26:28 UTC (rev 343)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-12-18 05:36:44 UTC (rev 344)
@@ -288,7 +288,8 @@
struct sigaction new_action;
cycle_key = G15_KEY_L1;
unsigned char user[256];
-
+ unsigned int lcdlevel = 1;
+
pthread_t keyboard_thread;
pthread_t lcd_thread;
memset(user,0,256);
@@ -353,6 +354,13 @@
}
}
+ if (!strncmp(daemonargs, "-l",2) || !strncmp(daemonargs, "--lcdlevel",7)) {
+ if((argv[i+1])!=NULL)
+ if(isdigit(argv[i+1][0])){
+ lcdlevel = atoi(argv[i+1]);
+ }
+ }
+
}
if(uf_return_running()>=0) {
g15daemon_log(LOG_ERR,"G15Daemon already running.. Exiting");
@@ -414,7 +422,8 @@
setLCDContrast(1);
setLEDs(0);
lcdlist->kb_backlight_state=1;
- setLCDBrightness(lcdlist->kb_backlight_state);
+ lcdlist->current->lcd->backlight_state=lcdlevel;
+ setLCDBrightness(lcdlevel);
#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200
@@ -481,7 +490,7 @@
/* switch off the lcd backlight */
char *blank=malloc(G15_BUFFER_LEN);
memset(blank,0,G15_BUFFER_LEN);
- uf_write_buf_to_g15(blank);
+ writePixmapToLCD(blank);
free(blank);
setLCDBrightness(0);
#ifdef LIBG15_VERSION
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2007-12-18 05:37:45
|
Revision: 345
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=345&view=rev
Author: mlampard
Date: 2007-12-17 21:37:50 -0800 (Mon, 17 Dec 2007)
Log Message:
-----------
Fix compiler warnings.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-12-18 05:36:44 UTC (rev 344)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-12-18 05:37:50 UTC (rev 345)
@@ -490,7 +490,7 @@
/* switch off the lcd backlight */
char *blank=malloc(G15_BUFFER_LEN);
memset(blank,0,G15_BUFFER_LEN);
- writePixmapToLCD(blank);
+ writePixmapToLCD((unsigned char*)blank);
free(blank);
setLCDBrightness(0);
#ifdef LIBG15_VERSION
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2007-12-18 05:44:31
|
Revision: 346
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=346&view=rev
Author: mlampard
Date: 2007-12-17 21:44:36 -0800 (Mon, 17 Dec 2007)
Log Message:
-----------
Update helptext to reflect lcdlevel.
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-12-18 05:37:50 UTC (rev 345)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-12-18 05:44:36 UTC (rev 346)
@@ -323,13 +323,13 @@
if (!strncmp(daemonargs, "-h",2) || !strncmp(daemonargs, "--help",6)) {
printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running");
- printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) or -v (--version)\n\n -k will kill a previous incarnation",argv[0]);
+ printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) [level] or -v (--version) or -l (--lcdlevel) [0-2] \n\n -k will kill a previous incarnation",argv[0]);
#ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200
printf(", if uppercase -K or -KILL turn off the keyboard backlight on the way out.");
#endif
#endif
- printf("\n -h shows this help\n -s changes the screen-switch key from MR to L1\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n");
+ printf("\n -h shows this help\n -s changes the screen-switch key from MR to L1\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n -l set default LCD backlight level\n");
exit(0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2007-12-27 10:21:38
|
Revision: 364
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=364&view=rev
Author: mlampard
Date: 2007-12-27 02:20:50 -0800 (Thu, 27 Dec 2007)
Log Message:
-----------
Log warning if keyboard disapears
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2007-12-27 06:29:14 UTC (rev 363)
+++ trunk/g15daemon-wip/g15daemon/main.c 2007-12-27 10:20:50 UTC (rev 364)
@@ -197,7 +197,8 @@
}else if(retval == -ENODEV && LIBG15_VERSION>=1200) {
pthread_mutex_lock(&g15lib_mutex);
while((retval=re_initLibG15() != G15_NO_ERROR) && !leaving){
- sleep(1);
+ g15daemon_log(LOG_WARNING,"Keyboard has gone.. Retrying\n");
+ sleep(1);
}
if(!leaving) {
masterlist->current->lcd->state_changed=1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-01 11:21:13
|
Revision: 375
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=375&view=rev
Author: mlampard
Date: 2008-01-01 03:21:05 -0800 (Tue, 01 Jan 2008)
Log Message:
-----------
Change verbosity levels
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2008-01-01 11:20:21 UTC (rev 374)
+++ trunk/g15daemon-wip/g15daemon/main.c 2008-01-01 11:21:05 UTC (rev 375)
@@ -360,8 +360,8 @@
}
if(g15daemon_debug){
g15daemon_log(LOG_INFO, "G15Daemon %s Build Date: %s",PACKAGE_VERSION,BUILD_DATE);
- g15daemon_log(LOG_INFO, "Build OS: %s",BUILD_OS_NAME);
- g15daemon_log(LOG_INFO, "With compiler: %s",COMPILER_VERSION);
+ g15daemon_log(LOG_DEBUG, "Build OS: %s",BUILD_OS_NAME);
+ g15daemon_log(LOG_DEBUG, "With compiler: %s",COMPILER_VERSION);
fprintf(stderr, "G15Daemon CMDLINE ARGS: ");
for(i=1;i<argc;i++)
fprintf(stderr, "%s ",argv[i]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mla...@us...> - 2008-01-01 11:32:53
|
Revision: 379
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=379&view=rev
Author: mlampard
Date: 2008-01-01 03:32:57 -0800 (Tue, 01 Jan 2008)
Log Message:
-----------
Change syslog output to go LOG_USER
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/main.c
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2008-01-01 11:27:49 UTC (rev 378)
+++ trunk/g15daemon-wip/g15daemon/main.c 2008-01-01 11:32:57 UTC (rev 379)
@@ -408,7 +408,7 @@
struct passwd *nobody;
unsigned char location[1024];
- openlog("g15daemon", LOG_PID, LOG_DAEMON);
+ openlog("g15daemon", LOG_PID, LOG_USER);
if(strlen((char*)user)==0){
nobody = getpwnam("nobody");
}else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|