[hal,wpilib] Use new DS available API from mrccomm (#8302)

Instead of just having a max count for joystick values, there's an available mask of values. This is because in the future we're expecting there to be holes in the list of available buttons and axes. This updates everything to support that scenario.

Also, Joystick buttons, axes, and POVs all now start at 0 instead of 1.
This commit is contained in:
Thad House
2025-10-25 23:03:50 -07:00
committed by GitHub
parent 429698f508
commit 2e10f91e07
62 changed files with 6101 additions and 1066 deletions

View File

@@ -20,9 +20,9 @@ public class {{ ConsoleName }}ControllerSim extends GenericHIDSim {
@SuppressWarnings("this-escape")
public {{ ConsoleName }}ControllerSim({{ ConsoleName }}Controller joystick) {
super(joystick);
setAxisCount({{ sticks|length + triggers|length }});
setButtonCount({{ buttons|length }});
setPOVCount(1);
setAxesMaximumIndex({{ sticks|length + triggers|length }});
setButtonsMaximumIndex({{ buttons|length }});
setPOVsMaximumIndex(1);
}
/**
@@ -33,9 +33,9 @@ public class {{ ConsoleName }}ControllerSim extends GenericHIDSim {
@SuppressWarnings("this-escape")
public {{ ConsoleName }}ControllerSim(int port) {
super(port);
setAxisCount({{ sticks|length + triggers|length }});
setButtonCount({{ buttons|length }});
setPOVCount(1);
setAxesMaximumIndex({{ sticks|length + triggers|length }});
setButtonsMaximumIndex({{ buttons|length }});
setPOVsMaximumIndex(1);
}
{% for stick in sticks %}
/**