Skip to content

Commit d2265ce

Browse files
authored
Fix cam x/y input range
1 parent 31f4025 commit d2265ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libraries/TinyUSB_Devices/TinyUSB_Devices.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,11 @@ void AbsMouse5_::release(uint8_t button)
462462

463463
void Gamepad16_::moveCam(uint16_t origX, uint16_t origY) {
464464
if(stickRight) {
465-
gamepad16Report.X = map(origX, 0, 32768, 0, 65535);
466-
gamepad16Report.Y = map(origY, 0, 32768, 0, 65535);
465+
gamepad16Report.X = map(origX, 0, 32767, 0, 65535);
466+
gamepad16Report.Y = map(origY, 0, 32767, 0, 65535);
467467
} else {
468-
gamepad16Report.Rx = map(origX, 0, 32768, 0, 65535);
469-
gamepad16Report.Ry = map(origY, 0, 32768, 0, 65535);
468+
gamepad16Report.Rx = map(origX, 0, 32767, 0, 65535);
469+
gamepad16Report.Ry = map(origY, 0, 32767, 0, 65535);
470470
}
471471
if(_autoReport) {
472472
report();

0 commit comments

Comments
 (0)