コード例 #1
0
ファイル: PowerJNI.cpp プロジェクト: steve532/allwpilib
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getUserVoltage3V3
 * Signature: ()F
 */
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage3V3
  (JNIEnv * env, jclass)
{
	int32_t status = 0;
	float val = getUserVoltage3V3(&status);
  CheckStatus(env, status);
  return val;
}
コード例 #2
0
ファイル: ControllerPower.cpp プロジェクト: FRC3238/allwpilib
/**
 * Get the voltage of the 3.3V rail
 * @return The controller 3.3V rail voltage value in Volts
 */
double ControllerPower::GetVoltage3V3() {
  int32_t status = 0;
  double retVal = getUserVoltage3V3(&status);
  wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
  return retVal;
}
コード例 #3
0
ファイル: PowerJNI.cpp プロジェクト: Talos4757/allwpilib
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getUserVoltage3V3
 * Signature: (Ljava/nio/IntBuffer;)F
 */
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage3V3
  (JNIEnv * env, jclass, jobject status)
{
	jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
	return getUserVoltage3V3(statusPtr);
}