aboutsummaryrefslogtreecommitdiff
path: root/linuxjoystick.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2004-05-28 01:03:21 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2004-05-28 01:03:21 +0000
commit59975e541343e6782ed8ada7ada1d28f3a5b7929 (patch)
treec187f0e74f15f98a19eabd2cb46af0aa02564bfa /linuxjoystick.c
parent77f6224967e5cd688026b5c3f988708b6d6b05e4 (diff)
cleaned up code a bit following Miller's naming scheme
svn path=/trunk/externals/hcs/; revision=1781
Diffstat (limited to 'linuxjoystick.c')
-rw-r--r--linuxjoystick.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/linuxjoystick.c b/linuxjoystick.c
index aa80603..0a90535 100644
--- a/linuxjoystick.c
+++ b/linuxjoystick.c
@@ -2,7 +2,7 @@
#define LINUXJOYSTICK_AXES 6
-static char *version = "$Revision: 1.5 $";
+static char *version = "$Revision: 1.6 $";
/*------------------------------------------------------------------------------
* CLASS DEF
@@ -14,9 +14,9 @@ typedef struct _linuxjoystick {
t_int x_fd;
t_symbol *x_devname;
t_clock *x_clock;
- int read_ok;
- int started;
- int x_delaytime;
+ int x_read_ok;
+ int x_started;
+ int x_delay;
#ifdef __gnu_linux__
struct input_event x_input_event;
#endif
@@ -34,10 +34,10 @@ typedef struct _linuxjoystick {
void linuxjoystick_stop(t_linuxjoystick* x) {
DEBUG(post("linuxjoystick_stop"););
- if (x->x_fd >= 0 && x->started) {
+ if (x->x_fd >= 0 && x->x_started) {
clock_unset(x->x_clock);
post("linuxjoystick: polling stopped");
- x->started = 0;
+ x->x_started = 0;
}
}
@@ -268,8 +268,8 @@ static int linuxjoystick_read(t_linuxjoystick *x,int fd) {
}
#endif
- if (x->started) {
- clock_delay(x->x_clock, x->x_delaytime);
+ if (x->x_started) {
+ clock_delay(x->x_clock, x->x_delay);
}
return 1;
@@ -286,9 +286,9 @@ void linuxjoystick_delay(t_linuxjoystick* x, t_float f) {
/* if the user sets the delay less than zero, reset to default */
if ( f > 0 ) {
- x->x_delaytime = (int)f;
+ x->x_delay = (int)f;
} else {
- x->x_delaytime = 5;
+ x->x_delay = DEFAULT_DELAY;
}
}
@@ -296,10 +296,10 @@ void linuxjoystick_start(t_linuxjoystick* x) {
DEBUG(post("linuxjoystick_start"););
#ifdef __linux__
- if (x->x_fd >= 0 && !x->started) {
- clock_delay(x->x_clock, 5);
+ if (x->x_fd >= 0 && !x->x_started) {
+ clock_delay(x->x_clock, DEFAULT_DELAY);
post("linuxjoystick: polling started");
- x->started = 1;
+ x->x_started = 1;
} else {
post("You need to set a input device (i.e /dev/input/event0)");
}
@@ -332,9 +332,9 @@ static void *linuxjoystick_new(t_symbol *s) {
/* init vars */
x->x_fd = -1;
- x->read_ok = 1;
- x->started = 0;
- x->x_delaytime = 5;
+ x->x_read_ok = 1;
+ x->x_started = 0;
+ x->x_delay = DEFAULT_DELAY;
x->x_clock = clock_new(x, (t_method)linuxjoystick_read);
/* create outlets for each axis */