hid: joystick reports kill device, mouse/keyboard OK

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
vputz
Posts: 4
Joined: Mon May 25, 2009 11:34 am

hid: joystick reports kill device, mouse/keyboard OK

Post by vputz » Mon May 25, 2009 11:45 am

I'm working on a fun little device which converts the old serial SpaceOrb 360, SpaceBall 2000/4000, and Magellan devices to USB joystick/mouse/keyboard devices. Works like a charm--sort of. It used to work beautifully as a joystick, but now that I've added keyboard and mouse, the keyboard/mouse bindings work well but enabling joystick reports kills the device.

In short, we have three reports: an 80-bit joystick report (report ID 4), a 48-bit keyboard report (report ID 2), and a 32-bit mouse report (report ID 3). To send the joystick report, I do the trick of sending the first 8 bytes (1 byte for the ID, 7 bytes of the message), waiting for usbInterruptIsReady(), then sending the last three bytes of the message; the mouse and keyboard reports can be sent in one go.

Watching the USB subsystem with USBHound, I can actually send "joystick is centered" messages and the device will not crash. But if I send a message that it's off-center, I get a "stall" situation and the device is dropped. My suspicion is that this has to do with the second part of the joystick message--that maybe the USB subsystem is trying to look at that first byte and make it a report id (?). Is that likely? Should I try and break up the joystick report into two separate reports or some such?

Sorry for the confusion. I can post as much info as would be helpful (device descriptors etc) but wasn't sure if someone would see the description and think "ah, here is the problem" and didn't want to clutter the boards with excess info.

-->VPutz

Post Reply