mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
Changes HAL to return -1 to 1 for joysticks (#35)
First part of the HAL changes. Returns -1 to 1 for joysticks instead of -128 to 127. Implemented by replacing the old structure with a new structure that uses floats instead of shorts.
This commit is contained in:
committed by
Peter Johnson
parent
a4f0c4fbe0
commit
54092378e9
@@ -31,11 +31,11 @@ public class DriverStation implements RobotState.Interface {
|
||||
}
|
||||
|
||||
private class HALJoystickAxes {
|
||||
public short[] m_axes;
|
||||
public float[] m_axes;
|
||||
public byte m_count;
|
||||
|
||||
public HALJoystickAxes(int count) {
|
||||
m_axes = new short[count];
|
||||
m_axes = new float[count];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -224,8 +224,8 @@ public class FRCNetworkCommunicationsLibrary extends JNIWrapper {
|
||||
|
||||
public static int kMaxJoystickAxes = 12;
|
||||
public static int kMaxJoystickPOVs = 12;
|
||||
|
||||
public static native byte HALGetJoystickAxes(byte joystickNum, short[] axesArray);
|
||||
|
||||
public static native byte HALGetJoystickAxes(byte joystickNum, float[] axesArray);
|
||||
|
||||
public static native byte HALGetJoystickPOVs(byte joystickNum, short[] povsArray);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user