Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Teensy Mouse connected to slow polling USB host?

  1. #1

    Teensy Mouse connected to slow polling USB host?

    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?

  2. #2
    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(ver sion 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:

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts