Support for the "USER" button on the RoboRIO

You can get the state of the USER button with GetUserButton() in
C++ or Utility.getUserButton() in java.

Change-Id: I923e62cab5e621ef43fed503acab5c0d751264fb
This commit is contained in:
Thomas Clark
2014-07-29 14:34:52 -04:00
parent 8b612f713b
commit 6deb196e90
7 changed files with 59 additions and 13 deletions

View File

@@ -116,6 +116,23 @@ JNIEXPORT jlong JNICALL Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGATime
}
/*
* Class: edu_wpi_first_wpilibj_hal_HALUtil
* Method: getFPGAButton
* Signature: (Ljava/nio/IntBuffer;)I
*/
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGAButton
(JNIEnv * env, jclass, jobject status)
{
//HALUTIL_LOG(logDEBUG) << "Calling HALUtil getFPGATime";
jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
jboolean returnValue = getFPGAButton( statusPtr );
//HALUTIL_LOG(logDEBUG) << "Status = " << *statusPtr;
//HALUTIL_LOG(logDEBUG) << "FPGATime = " << returnValue;
return returnValue;
}
/*
* Class: edu_wpi_first_wpilibj_hal_HALUtil
* Method: getHALErrorMessage