Implement DriverStation::GetBatteryVoltage

Make the GetBatteryVoltage method work using the new tPower header

Change-Id: If504f8a46f3f7f737f0b729b72fc6b5da0d29ff9
This commit is contained in:
Thomas Clark
2014-08-08 14:56:22 -04:00
parent f4d542b212
commit d2cd5f3571
8 changed files with 217 additions and 6 deletions

View File

@@ -0,0 +1,99 @@
#include <jni.h>
#include "edu_wpi_first_wpilibj_hal_PowerJNI.h"
#include "HAL/Power.hpp"
/*
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
* Method: getVinVoltage
* Signature: (Ljava/nio/IntBuffer;)F
*/
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinVoltage
(JNIEnv * env, jclass, jobject status)
{
jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
return getVinVoltage(statusPtr);
}
/*
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
* Method: getVinCurrent
* Signature: (Ljava/nio/IntBuffer;)F
*/
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinCurrent
(JNIEnv * env, jclass, jobject status)
{
jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
return getVinCurrent(statusPtr);
}
/*
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
* Method: getUserVoltage6V
* Signature: (Ljava/nio/IntBuffer;)F
*/
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage6V
(JNIEnv * env, jclass, jobject status)
{
jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
return getUserVoltage6V(statusPtr);
}
/*
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
* Method: getUserCurrent6V
* Signature: (Ljava/nio/IntBuffer;)F
*/
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent6V
(JNIEnv * env, jclass, jobject status)
{
jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
return getUserCurrent6V(statusPtr);
}
/*
* 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);
}
/*
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
* Method: getUserCurrent5V
* Signature: (Ljava/nio/IntBuffer;)F
*/
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent5V
(JNIEnv * env, jclass, jobject status)
{
jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
return getUserCurrent5V(statusPtr);
}
/*
* 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);
}
/*
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
* Method: getUserCurrent3V3
* Signature: (Ljava/nio/IntBuffer;)F
*/
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent3V3
(JNIEnv * env, jclass, jobject status)
{
jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
return getUserCurrent3V3(statusPtr);
}