From a31c391dc384912d8eb511feb62a12aae0ce7005 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 23 Oct 2004 03:40:39 +0000 Subject: got everything running under GNU/Linux again, time to switch back to MacOS X svn path=/trunk/externals/hcs/hid/; revision=2144 --- hid.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'hid.c') diff --git a/hid.c b/hid.c index c1d47a7..f5dde12 100644 --- a/hid.c +++ b/hid.c @@ -26,8 +26,19 @@ #include "hid.h" #include "input_arrays.h" + +/* this should be removed once things are ported to hid_linux.c */ #include "../linuxhid.h" +/*------------------------------------------------------------------------------ + * LOCAL DEFINES + */ + +#define DEBUG(x) +//#define DEBUG(x) x + +#define DEFAULT_DELAY 300 + /*------------------------------------------------------------------------------ * IMPLEMENTATION */ @@ -56,6 +67,7 @@ void hid_stop(t_hid* x) hid_devicelist_refresh(x); } + static t_int hid_close(t_hid *x) { DEBUG(post("hid_close");); @@ -70,6 +82,7 @@ static t_int hid_close(t_hid *x) return 1; } + static t_int hid_open(t_hid *x, t_symbol *s) { DEBUG(post("hid_open");); @@ -78,7 +91,7 @@ static t_int hid_open(t_hid *x, t_symbol *s) char *eventTypeName = ""; /* counts for various event types */ t_int synCount,keyCount,relCount,absCount,mscCount,ledCount,sndCount,repCount,ffCount,pwrCount,ff_statusCount; -#ifdef __gnu_linux__ +#ifdef __linux__ struct input_event hid_input_event; unsigned long bitmask[EV_MAX][NBITS(KEY_MAX)]; #endif @@ -92,7 +105,7 @@ static t_int hid_open(t_hid *x, t_symbol *s) if (s != &s_) x->x_devname = s; -#ifdef __gnu_linux__ +#ifdef __linux__ /* open device */ if (x->x_devname) { @@ -204,11 +217,12 @@ static t_int hid_open(t_hid *x, t_symbol *s) post("As I write cross-platform versions, the interface might have to change."); post("WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING"); post("================================= [hid] =================================\n"); -#endif /* #ifdef __gnu_linux__ */ +#endif /* #ifdef __linux__ */ - return 1; + return 1; /* why is this return 1? */ } + static t_int hid_read(t_hid *x,int fd) { t_atom event_data[5]; /* this should probably be 4, not 5 */ -- cgit v1.2.1