Teensy Mouse connected to slow polling USB host?

Status
Not open for further replies.

btspp

Active member
What happens to Mouse.move inputs when the USB host has a 125hz polling rate and the bInterval for Teensy is 1 or 1000hz?

How does Teensy or USB work when Mouse.move is called multiple times in a loop?

I expect all move packets are buffered at the endpoint and the USB host reads all packets when it polls the endpoint. Is my understanding correct?

If not, can I send Mouse.move only when the host reads the endpoint?
 
I dont know exactly how the whole usb chain works for Mouse.move for that you would need to look in the following folder C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy(version number)

usb_mouse.c - implements Mouse.move
usb.c - implements the usb_transmit function

Sorry I cant really explain the whole process I looked at the code a few times but the schedule_transfer function is a bit complicated.

I dont know what problem you are running into. But maybe you could use your own timer and limit your program to only send updated movement data to mouse.Move every 8 milliseconds (125Hz).
You can keep adding movement data into your own x and y variables and then send it when your timer passes 8 ms.
If you are running into the same problem as I did where the movement data easily overflows the 8 bit x and y value at 125Hz you can also make usb_mouse_move 16 bit: https://forum.pjrc.com/threads/68580-usb_mouse_move-16-bit-x-and-y-request
 
Status
Not open for further replies.
Back
Top