PaulStoffregen / USBHost_t36

USB Host Library for Teensy 3.6 and 4.0
167 stars 86 forks source link

Joystick.cpp wireless 360 controller SetLEDs does not work #35

Open Ryzee119 opened 4 years ago

Ryzee119 commented 4 years ago

The problem

The SetLEDs function uses lr https://github.com/PaulStoffregen/USBHost_t36/blob/e64808debe03673dae038f22b2685ca09c5b4990/joystick.cpp#L200

The issue is this macro bitshifts left lr by 16, so the resulting value passed is always zero and the LED on the controller is not set. https://github.com/PaulStoffregen/USBHost_t36/blob/e64808debe03673dae038f22b2685ca09c5b4990/USBHost_t36.h#L915

The fix:

Either the macro should be fixed, or lr should be changed to lb in this function: https://github.com/PaulStoffregen/USBHost_t36/blob/e64808debe03673dae038f22b2685ca09c5b4990/joystick.cpp#L200