mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[hal] JNI setDIO: use a boolean and not a short (#3469)
This commit is contained in:
@@ -14,8 +14,7 @@ public class DIOJNI extends JNIWrapper {
|
||||
|
||||
public static native void setDIOSimDevice(int handle, int device);
|
||||
|
||||
// TODO(Thad): Switch this to use boolean
|
||||
public static native void setDIO(int dioPortHandle, short value);
|
||||
public static native void setDIO(int dioPortHandle, boolean value);
|
||||
|
||||
public static native void setDIODirection(int dioPortHandle, boolean input);
|
||||
|
||||
|
||||
@@ -75,11 +75,11 @@ Java_edu_wpi_first_hal_DIOJNI_setDIOSimDevice
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_DIOJNI
|
||||
* Method: setDIO
|
||||
* Signature: (IS)V
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_DIOJNI_setDIO
|
||||
(JNIEnv* env, jclass, jint id, jshort value)
|
||||
(JNIEnv* env, jclass, jint id, jboolean value)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_SetDIO((HAL_DigitalHandle)id, value, &status);
|
||||
|
||||
@@ -57,7 +57,7 @@ public class DigitalOutput extends DigitalSource implements Sendable {
|
||||
* @param value true is on, off is false
|
||||
*/
|
||||
public void set(boolean value) {
|
||||
DIOJNI.setDIO(m_handle, (short) (value ? 1 : 0));
|
||||
DIOJNI.setDIO(m_handle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user