mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
WPILib Reorganization
This is a major restructuring of the WPILib repository to simply build procedures and remove the remnants of Maven from everything except the eclipse plugins. Gradle files have been largely simplified or rewritten, taking advantage of splitting up parts of the build into separate build files for ease of reading. The eclipse plugins are now in a separate project, as is ntcore. All dependencies are resolved via Maven dependencies, with the Jenkins-maintained WPILib repo. Project structures have also been simplified: we no longer have separate subprojects inside wpilibc and wpilibj. Where possible, these changes hav been done with git renames, to make sure we still have full history for all repositories. Other unrelated subprojects have also been broken out: OutlineViewer is now a separate project. Change-Id: Ib4e2a6e1a2f66427a14f16612b0e0d69ed661878
This commit is contained in:
204
wpilibj/src/athena/cpp/lib/PowerJNI.cpp
Normal file
204
wpilibj/src/athena/cpp/lib/PowerJNI.cpp
Normal file
@@ -0,0 +1,204 @@
|
||||
#include <jni.h>
|
||||
#include "edu_wpi_first_wpilibj_hal_PowerJNI.h"
|
||||
#include "HAL/Power.hpp"
|
||||
#include "HALUtil.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getVinVoltage
|
||||
* Signature: ()F
|
||||
*/
|
||||
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinVoltage
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
float val = getVinVoltage(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getVinCurrent
|
||||
* Signature: ()F
|
||||
*/
|
||||
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinCurrent
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
float val = getVinCurrent(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getUserVoltage6V
|
||||
* Signature: ()F
|
||||
*/
|
||||
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage6V
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
float val = getUserVoltage6V(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getUserCurrent6V
|
||||
* Signature: ()F
|
||||
*/
|
||||
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent6V
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
float val = getUserCurrent6V(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getUserActive6V
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive6V
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = getUserActive6V(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getUserCurrentFaults6V
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults6V
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
int val = getUserCurrentFaults6V(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getUserCurrent5V
|
||||
* Signature: ()F
|
||||
*/
|
||||
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent5V
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
float val = getUserCurrent5V(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getUserActive5V
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive5V
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = getUserActive5V(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getUserCurrent3V3
|
||||
* Signature: ()F
|
||||
*/
|
||||
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent3V3
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
float val = getUserCurrent3V3(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getUserActive3V3
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive3V3
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = getUserActive3V3(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PowerJNI
|
||||
* Method: getUserCurrentFaults3V3
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults3V3
|
||||
(JNIEnv * env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
int val = getUserCurrentFaults3V3(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
Reference in New Issue
Block a user