mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal,wpilib,cmd] Update POVs to use enums (#7978)
This commit is contained in:
@@ -315,14 +315,14 @@ double DriverStation::GetStickAxis(int stick, int axis) {
|
||||
return axes.axes[axis];
|
||||
}
|
||||
|
||||
int DriverStation::GetStickPOV(int stick, int pov) {
|
||||
DriverStation::POVDirection DriverStation::GetStickPOV(int stick, int pov) {
|
||||
if (stick < 0 || stick >= kJoystickPorts) {
|
||||
FRC_ReportError(warn::BadJoystickIndex, "stick {} out of range", stick);
|
||||
return -1;
|
||||
return kCenter;
|
||||
}
|
||||
if (pov < 0 || pov >= HAL_kMaxJoystickPOVs) {
|
||||
FRC_ReportError(warn::BadJoystickAxis, "POV {} out of range", pov);
|
||||
return -1;
|
||||
return kCenter;
|
||||
}
|
||||
|
||||
HAL_JoystickPOVs povs;
|
||||
@@ -333,10 +333,10 @@ int DriverStation::GetStickPOV(int stick, int pov) {
|
||||
"Joystick POV {} missing (max {}), check if all controllers are "
|
||||
"plugged in",
|
||||
pov, povs.count);
|
||||
return -1;
|
||||
return kCenter;
|
||||
}
|
||||
|
||||
return povs.povs[pov];
|
||||
return static_cast<POVDirection>(povs.povs[pov]);
|
||||
}
|
||||
|
||||
int DriverStation::GetStickButtons(int stick) {
|
||||
|
||||
Reference in New Issue
Block a user