aboutsummaryrefslogtreecommitdiff
path: root/hid_linux.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-06-02 20:06:51 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-06-02 20:06:51 +0000
commit8f9f7fa21b948a03e076e7a6a6dc91bc9eb701f7 (patch)
treee367d70c9fbe1446fb249d2fe7f99fbae58f2251 /hid_linux.c
parente6087aad22076ca3f2066020bd4271bb0991d370 (diff)
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
Diffstat (limited to 'hid_linux.c')
-rw-r--r--hid_linux.c8
1 files changed, 4 insertions, 4 deletions
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)
{