From 8f9f7fa21b948a03e076e7a6a6dc91bc9eb701f7 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 2 Jun 2006 20:06:51 +0000 Subject: ripped out old method of get events and build whole new method which should use a lot less CPU; its now based on arrays of structs that are built before running. There is a 2D array for (device,element) struct, t_hid_element, which holds the output symbols, thus eliminating symbol lookups for each event that is outputted; its Mac OS X only write now, GNU/Linux will come eventually... svn path=/trunk/externals/hcs/hid/; revision=5156 --- hid_linux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hid_linux.c') diff --git a/hid_linux.c b/hid_linux.c index 05d8fa8..93b3b3b 100644 --- a/hid_linux.c +++ b/hid_linux.c @@ -348,7 +348,7 @@ void hid_ff_print( t_hid *x ) /* Pd [hid] FUNCTIONS */ /* ------------------------------------------------------------------------------ */ -t_int hid_get_events(t_hid *x) +void hid_get_events(t_hid *x) { debug_print(LOG_DEBUG,"hid_get_events"); @@ -362,7 +362,7 @@ t_int hid_get_events(t_hid *x) */ struct input_event hid_input_event; - if (x->x_fd < 0) return 0; + if (x->x_fd < 0) return; while( read (x->x_fd, &(hid_input_event), sizeof(struct input_event)) > -1 ) { @@ -398,7 +398,7 @@ t_int hid_get_events(t_hid *x) //post("output %d events",event_counter); ); - return (0); + return; } @@ -420,7 +420,7 @@ t_int hid_open_device(t_hid *x, t_int device_number) x->x_fd = -1; x->x_device_number = device_number; - sprintf(dev_handle_name,"/dev/input/event%d",(int)x->x_device_number); + sprintf(dev_handle_name,"/dev/input/event%d",x->x_device_number); if (dev_handle_name) { -- cgit v1.2.1