Exemple #1
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getUserCurrentFaults5V
 * Signature: ()I
 */
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults5V
  (JNIEnv * env, jclass)
{
	int32_t status = 0;
	int val = getUserCurrentFaults5V(&status);
  CheckStatus(env, status);
  return val;
}
/**
 * Get the count of the total current faults on the 5V rail since the controller
 * has booted
 * @return The number of faults
 */
int ControllerPower::GetFaultCount5V() {
  int32_t status = 0;
  int retVal = getUserCurrentFaults5V(&status);
  wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
  return retVal;
}
Exemple #3
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getUserCurrentFaults5V
 * Signature: (Ljava/nio/IntBuffer;)I
 */
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults5V
  (JNIEnv * env, jclass, jobject status)
{
	jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
	return getUserCurrentFaults5V(statusPtr);
}