Skip to content

Commit

Permalink
Fix cam x/y input range
Browse files Browse the repository at this point in the history
  • Loading branch information
SeongGino authored Jun 18, 2024
1 parent 31f4025 commit d2265ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libraries/TinyUSB_Devices/TinyUSB_Devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,11 @@ void AbsMouse5_::release(uint8_t button)

void Gamepad16_::moveCam(uint16_t origX, uint16_t origY) {
if(stickRight) {
gamepad16Report.X = map(origX, 0, 32768, 0, 65535);
gamepad16Report.Y = map(origY, 0, 32768, 0, 65535);
gamepad16Report.X = map(origX, 0, 32767, 0, 65535);
gamepad16Report.Y = map(origY, 0, 32767, 0, 65535);
} else {
gamepad16Report.Rx = map(origX, 0, 32768, 0, 65535);
gamepad16Report.Ry = map(origY, 0, 32768, 0, 65535);
gamepad16Report.Rx = map(origX, 0, 32767, 0, 65535);
gamepad16Report.Ry = map(origY, 0, 32767, 0, 65535);
}
if(_autoReport) {
report();
Expand Down

0 comments on commit d2265ce

Please sign in to comment.