Re: [Emc-users] Joypad Example

2008-03-02 Thread Jeff Epler
On Sun, Mar 02, 2008 at 10:34:28PM -0500, Stephen Wille Padnos wrote: > The reason is that there's no way to get a complete list of all joystick > devices (axes and buttons) before you get the first "event". If you try > to enumerate all the axes first, and the joystick gets moved while > you're d

Re: [Emc-users] Joypad Example

2008-03-02 Thread Stephen Wille Padnos
Hmmm - it looks like nobody ever answered your original questions here. Kirk Wallace wrote: >I think hal_joystick.c: > >http://cvs.linuxcnc.org/cgi-bin/cvsweb.cgi/emc2/src/hal/user_comps/devices/hal_joystick.c?rev=1.2;content-type=text%2Fplain > > Note that this is superseded by hal_input, whic

Re: [Emc-users] Joypad Example

2008-02-23 Thread Alex Joni
> Thanks Ben. The cast makes sense. I think of void as being an invention > to allow functions that return nothing, so the function return type > (void *) tells me that a pointer is returned that points to a > nonexistent variable. Is the (void *) just a reminder to always cast the > return pointer

Re: [Emc-users] Joypad Example

2008-02-23 Thread Kirk Wallace
On Sat, 2008-02-23 at 07:52 +, ben lipkowitz wrote: > On Fri, 22 Feb 2008, Kirk Wallace wrote: > > Another bit I don't understand: > > > >/* STEP 3: allocate shared memory for joystick data */ > >js_data = (hal_js_t *) hal_malloc(sizeof(hal_js_t)); > >if (js_data == 0) { > > pri

Re: [Emc-users] Joypad Example

2008-02-23 Thread ben lipkowitz
On Fri, 22 Feb 2008, Kirk Wallace wrote: > Another bit I don't understand: > >/* STEP 3: allocate shared memory for joystick data */ >js_data = (hal_js_t *) hal_malloc(sizeof(hal_js_t)); >if (js_data == 0) { > printf( "ERROR: hal_malloc() failed\n"); > hal_exit(comp_id); >

Re: [Emc-users] Joypad Example

2008-02-22 Thread Kirk Wallace
On Fri, 2008-02-22 at 17:51 -0800, Kirk Wallace wrote: > I think hal_joystick.c: > > http://cvs.linuxcnc.org/cgi-bin/cvsweb.cgi/emc2/src/hal/user_comps/devices/hal_joystick.c?rev=1.2;content-type=text%2Fplain > > might be a good model to follow for making my modbus user-land > component. My guess

[Emc-users] Joypad Example

2008-02-22 Thread Kirk Wallace
I think hal_joystick.c: http://cvs.linuxcnc.org/cgi-bin/cvsweb.cgi/emc2/src/hal/user_comps/devices/hal_joystick.c?rev=1.2;content-type=text%2Fplain might be a good model to follow for making my modbus user-land component. My guess would be that one would setup HAL and the the HAL pins and then lo