aboutsummaryrefslogtreecommitdiffstats
path: root/drv_picoLCDGraphic.c (follow)
AgeCommit message (Expand)AuthorFilesLines
2011-02-12timer.c: fixed detection of positive clock skew (and some typos)mzuther1-1/+1
2010-05-17Ticket #184 (LCD::contrast and LCD::backlight segfaulting) fixedmichael1-2/+2
2010-04-22drv_picoLCDGraphic.c: changed two annoying info messages to debugging messagesmzuther1-2/+2
2010-04-18drv_picoLCDGraphic.c: alternative use of keypad widgets (instead of GPIO)mzuther1-2/+78
2010-02-15drv_picoLCDGraphic.c: minimum USB read timeout is now 1 msmzuther1-1/+1
2010-02-14drv_picoLCDGraphic.c: added configuration for USB read timeoutmzuther1-1/+9
2010-01-24picoLCDGraphic: update display regularly using a timer (*much* faster than re...mzuther1-2/+30
2009-11-21* Fix segfault on shutdown in drv_picoLCDGraphic.cedman0071-2/+2
2009-02-28patch for picoLCDGraphics that adds keypad/gpi/gpo capabilities from Nicu Pavelmichael1-5/+30
2008-10-07Replace write to external variable usb_debug by calling usb_set_debug().bwalle1-2/+1
2008-10-06properties fixedmichael1-3/+3
2008-07-15forgot to add drv_picoLCDGraphic.c :-(michael1-0/+613
d } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* $Id$
 * $URL$
 *
 * plugin that forks and exec's once a key is pressed. the difference to the exec plugin is: this can also only be done once!
 *
 * Copyright (C) 2008, Wolfgang Henerbichler <wogri@wogri.com>
 *
 * This file is part of LCD4Linux.
 *
 * LCD4Linux is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * LCD4Linux is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

/* 
 * exported functions:
 *
 * int plugin_init_button_exec(void)
 *  adds various functions
 *
 */


/* define the include files you need */
#include "config.h"

#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>

/* these should always be included */
#include "debug.h"
#include "plugin.h"

#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif



/* sample function 'button_exec' */
/* takes as many arguments as you want, first arguemnt is the command that will be called via exec, all the following are parameters you want to add to your command - you won't know what has happened after forking - no return codes available */
/* Note: all local functions should be declared 'static' */

static void my_button_exec(RESULT * result, int argc, RESULT * argv[])
{
    int pid;
    int i;
    int errsv;
    char *args[argc + 1];
    char *arg;
    char *prog;

    signal(SIGCHLD, SIG_IGN);
    prog = R2S(argv[0]);
    info(prog);
    for (i = 1; i < argc; i++) {
	arg = R2S(argv[i]);
	args[i] = arg;
	info(arg);
    }
    args[0] = prog;
    args[i] = (char *) 0;
    pid = fork();
    if (pid == 0) {		/* child-process */
	/* char *args[] = {"-r", "-t", "-l", (char *) 0 }; */
	info("executing program");
	execvp(prog, args);
	errsv = errno;
	info("executing program failed");
	info(strerror(errsv));
	exit(0);
    } else if (pid == -1) {
	info("weird error has occured. couldn't fork.");
    } else {
	SetResult(&result, R_STRING, "0");
    }
}


/* plugin initialization */
/* MUST NOT be declared 'static'! */
int plugin_init_button_exec(void)
{

    /* register all our cool functions */
    /* the second parameter is the number of arguments */
    /* -1 stands for variable argument list */
    AddFunction("button_exec", -1, my_button_exec);
    return 0;
}

void plugin_exit_button_exec(void)
{
    /* free any allocated memory */
    /* close filedescriptors */
}