mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
All other HAL functions have status as the last parameter, only PDP did not. This changes makes the PDP parameter order consistent with the rest of the HAL. Change-Id: I725e33f75deab34e6a83b7048b2d6c365fa56a21
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(module, &status);
|
|
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(module, &status);
|
|
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(module, channel, &status);
|
|
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(module, &status);
|
|
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(module, &status);
|
|
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(module, &status);
|
|
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(module, &status);
|
|
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(module, &status);
|
|
CheckStatus(env, status, false);
|
|
}
|
|
|
|
} // extern "C"
|