Beispiel #1
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getUserVoltage5V
 * Signature: ()F
 */
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage5V
  (JNIEnv * env, jclass)
{
	int32_t status = 0;
	float val = getUserVoltage5V(&status);
  CheckStatus(env, status);
  return val;
}
Beispiel #2
0
/**
 * Get the voltage of the 5V rail
 * @return The controller 5V rail voltage value in Volts
 */
double ControllerPower::GetVoltage5V() {
  int32_t status = 0;
  double retVal = getUserVoltage5V(&status);
  wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
  return retVal;
}
Beispiel #3
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getUserVoltage5V
 * Signature: (Ljava/nio/IntBuffer;)F
 */
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage5V
  (JNIEnv * env, jclass, jobject status)
{
	jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
	return getUserVoltage5V(statusPtr);
}