From 1a74eae3dbdd38003446d963b829c5fe5e8cd274 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 11 Jun 2005 05:01:14 +0000 Subject: added barebones ff function to linux file so that it'll work svn path=/trunk/externals/hcs/hid/; revision=3166 --- Makefile | 12 +++++++---- hid_linux.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e0e340f..be7e008 100644 --- a/Makefile +++ b/Makefile @@ -31,10 +31,14 @@ endif PDEXECUTABLE = ../../../pd/bin/pd # generic optimization -#OPT_FLAGS = -O3 -ffast-math -# G4 optimization -OPT_FLAGS = -O3 -mcpu=7400 -faltivec -ffast-math -fPIC -# faster G4 7450 optimization (gives errors) +OPT_FLAGS = -O3 -ffast-math +# G4 optimization on Mac OS X +#OPT_FLAGS = -O3 -mcpu=7400 -maltivec -ffast-math -fPIC +# faster G4 7450 optimization (gives errors) on GNU/Linux +#OPT_FLAGS = -O3 -mcpu=7450 -maltivec -ffast-math -fPIC +# G4 optimization on Mac OS X +#OPT_FLAGS = -O3 -mcpu=7400 -faltivec -ffast-math -fPIC +# faster G4 7450 optimization (gives errors) on Mac OS X #OPT_FLAGS = -ffast -mcpu=7450 -faltivec -ffast-math -fPIC CFLAGS = $(OPT_FLAGS) -Wall -W -Wno-shadow -Wstrict-prototypes -Wno-unused diff --git a/hid_linux.c b/hid_linux.c index 92b589c..8134b78 100644 --- a/hid_linux.c +++ b/hid_linux.c @@ -257,6 +257,67 @@ void hid_print_device_list(void) post(""); } +/* ------------------------------------------------------------------------------ */ +/* FORCE FEEDBACK FUNCTIONS */ +/* ------------------------------------------------------------------------------ */ + +/* cross-platform force feedback functions */ +t_int hid_ff_autocenter( t_hid *x, t_float value ) +{ + return ( 0 ); +} + + +t_int hid_ff_gain( t_hid *x, t_float value ) +{ + return ( 0 ); +} + + +t_int hid_ff_motors( t_hid *x, t_float value ) +{ + return ( 0 ); +} + + +t_int hid_ff_continue( t_hid *x ) +{ + return ( 0 ); +} + + +t_int hid_ff_pause( t_hid *x ) +{ + return ( 0 ); +} + + +t_int hid_ff_reset( t_hid *x ) +{ + return ( 0 ); +} + + +t_int hid_ff_stopall( t_hid *x ) +{ + return ( 0 ); +} + + + +// these are just for testing... +t_int hid_ff_fftest ( t_hid *x, t_float value) +{ + return ( 0 ); +} + + +void hid_ff_print( t_hid *x ) +{ +} + + + /* ------------------------------------------------------------------------------ */ /* Pd [hid] FUNCTIONS */ /* ------------------------------------------------------------------------------ */ @@ -287,10 +348,14 @@ t_int hid_get_events(t_hid *x) hid_convert_linux_buttons_to_numbers(hid_input_event.code,hid_code); hid_convert_linux_keys(hid_input_event.code,hid_code); } - else + else if (event_names[hid_input_event.type][hid_input_event.code] != NULL) { strcpy(hid_code, event_names[hid_input_event.type][hid_input_event.code]); } + else + { + strcpy(hid_code, "unknown"); + } hid_output_event(x, ev[hid_input_event.type], hid_code, (t_float)hid_input_event.value); -- cgit v1.2.1