mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
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
130 lines
3.1 KiB
C++
130 lines
3.1 KiB
C++
#include "edu_wpi_first_wpilibj_hal_PDPJNI.h"
|
|
#include "HAL/PDP.hpp"
|
|
#include "HALUtil.h"
|
|
|
|
extern "C" {
|
|
|
|
/*
|
|
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
|
* Method: getPDPTemperature
|
|
* Signature: (I)V
|
|
*/
|
|
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_initializePDP
|
|
(JNIEnv *, jclass, jint module)
|
|
{
|
|
initializePDP(module);
|
|
}
|
|
|
|
/*
|
|
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
|
* Method: getPDPTemperature
|
|
* Signature: (I)D
|
|
*/
|
|
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTemperature
|
|
(JNIEnv *env, jclass, jint module)
|
|
{
|
|
int32_t status = 0;
|
|
double temperature = getPDPTemperature(&status, module);
|
|
CheckStatus(env, status, false);
|
|
return temperature;
|
|
}
|
|
|
|
/*
|
|
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
|
* Method: getPDPVoltage
|
|
* Signature: (I)D
|
|
*/
|
|
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPVoltage
|
|
(JNIEnv *env, jclass, jint module)
|
|
{
|
|
int32_t status = 0;
|
|
double voltage = getPDPVoltage(&status, module);
|
|
CheckStatus(env, status, false);
|
|
return voltage;
|
|
}
|
|
|
|
/*
|
|
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
|
* Method: getPDPChannelCurrent
|
|
* Signature: (BI)D
|
|
*/
|
|
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPChannelCurrent
|
|
(JNIEnv *env, jclass, jbyte channel, jint module)
|
|
{
|
|
int32_t status = 0;
|
|
double current = getPDPChannelCurrent(channel, &status, module);
|
|
CheckStatus(env, status, false);
|
|
return current;
|
|
}
|
|
|
|
/*
|
|
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
|
* Method: getPDPTotalCurrent
|
|
* Signature: (I)D
|
|
*/
|
|
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalCurrent
|
|
(JNIEnv *env, jclass, jint module)
|
|
{
|
|
int32_t status = 0;
|
|
double current = getPDPTotalCurrent(&status, module);
|
|
CheckStatus(env, status, false);
|
|
return current;
|
|
}
|
|
|
|
/*
|
|
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
|
* Method: getPDPTotalPower
|
|
* Signature: (I)D
|
|
*/
|
|
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalPower
|
|
(JNIEnv *env, jclass, jint module)
|
|
{
|
|
int32_t status = 0;
|
|
double power = getPDPTotalPower(&status, module);
|
|
CheckStatus(env, status, false);
|
|
return power;
|
|
}
|
|
|
|
/*
|
|
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
|
* Method: resetPDPTotalEnergy
|
|
* Signature: (I)D
|
|
*/
|
|
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalEnergy
|
|
(JNIEnv *env, jclass, jint module)
|
|
{
|
|
int32_t status = 0;
|
|
double energy = getPDPTotalEnergy(&status, module);
|
|
CheckStatus(env, status, false);
|
|
return energy;
|
|
}
|
|
|
|
|
|
/*
|
|
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
|
* Method: resetPDPTotalEnergy
|
|
* Signature: (I)V
|
|
*/
|
|
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_resetPDPTotalEnergy
|
|
(JNIEnv *env, jclass, jint module)
|
|
{
|
|
int32_t status = 0;
|
|
resetPDPTotalEnergy(&status, module);
|
|
CheckStatus(env, status, false);
|
|
}
|
|
|
|
/*
|
|
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
|
* Method: clearStickyFaults
|
|
* Signature: (I)V
|
|
*/
|
|
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_clearPDPStickyFaults
|
|
(JNIEnv *env, jclass, jint module)
|
|
{
|
|
int32_t status = 0;
|
|
clearPDPStickyFaults(&status, module);
|
|
CheckStatus(env, status, false);
|
|
}
|
|
|
|
} // extern "C"
|