Update hid-rp/include/hid-rp-gamepad.hpp (espp::GamepadInputReport) to support specifying the data type for the joystick and trigger inputs (default is std::uint16_t).
Motivation and Context
Previously the storage type was implicitly uint16_t and the min/max values were also uint16_t, but sometimes (and for some platforms) you may want to support negative ranges or you may want to only use one byte for joystick or triggers. This PR updates the class so you can specify such implementations.
How has this been tested?
Building and running the hid-rp/example and the hid_service/example on a QtPy ESP32s3. Tested the hid_service/example with Android and iOS.
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation Update
[ ] Hardware (schematic, board, system design) change
[x] Software change
Checklist:
[ ] My change requires a change to the documentation.
[ ] I have added / updated the documentation related to this change via either README or WIKI
Software
[ ] I have added tests to cover my changes.
[ ] I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
[x] All new and existing tests passed.
[x] My code follows the code style of this project.
Description
hid-rp/include/hid-rp-gamepad.hpp
(espp::GamepadInputReport
) to support specifying the data type for the joystick and trigger inputs (default isstd::uint16_t
).Motivation and Context
Previously the storage type was implicitly
uint16_t
and themin/max
values were alsouint16_t
, but sometimes (and for some platforms) you may want to support negative ranges or you may want to only use one byte for joystick or triggers. This PR updates the class so you can specify such implementations.How has this been tested?
Building and running the
hid-rp/example
and thehid_service/example
on a QtPy ESP32s3. Tested thehid_service/example
with Android and iOS.Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Types of changes
Checklist:
Software
.github/workflows/build.yml
file to add my new test to the automated cloud build github action.