Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
Add option to invert Y axis on dpad input
Browse files Browse the repository at this point in the history
  • Loading branch information
FeralAI committed Jan 13, 2022
1 parent fdb17d4 commit abeb3e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ lib_deps =
httpd
rndis
bblanchon/ArduinoJson@^6.18.5
https://github.com/FeralAI/MPG.git#58daf2a6d17fcd5a30b56f5b0a21a65ab22d75c9
https://github.com/FeralAI/MPG.git#b3234cc08e6a6f77e2da6e0863b1a889538b5f63
targets = upload
board_build.pio = lib/NeoPico/src/ws2812.pio
; extra_scripts = pre:build-web.py
Expand Down
4 changes: 2 additions & 2 deletions src/gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ void Gamepad::read()
#endif

state.dpad = 0
| ((values & mapDpadUp->pinMask) ? mapDpadUp->buttonMask : 0)
| ((values & mapDpadDown->pinMask) ? mapDpadDown->buttonMask : 0)
| ((values & mapDpadUp->pinMask) ? (options.invertYAxis ? mapDpadDown->buttonMask : mapDpadUp->buttonMask) : 0)
| ((values & mapDpadDown->pinMask) ? (options.invertYAxis ? mapDpadUp->buttonMask : mapDpadDown->buttonMask) : 0)
| ((values & mapDpadLeft->pinMask) ? mapDpadLeft->buttonMask : 0)
| ((values & mapDpadRight->pinMask) ? mapDpadRight->buttonMask : 0)
;
Expand Down

0 comments on commit abeb3e3

Please sign in to comment.