Support for the CAN power distribution panel

Change-Id: If4f8f7f050bf1095221cf16f030a6a8a67532656
This commit is contained in:
thomasclark
2014-05-30 14:04:05 -04:00
parent bf7ef4376c
commit 187aa7a138
13 changed files with 306 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
#include "edu_wpi_first_wpilibj_hal_PDPJNI.h"
#include "HAL/PDP.hpp"
/*
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
* Method: getPDPTemperature
* Signature: (Ljava/nio/IntBuffer;)D
*/
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTemperature
(JNIEnv *env, jclass, jobject status)
{
jint *status_ptr = (jint *)env->GetDirectBufferAddress(status);
return getPDPTemperature(status_ptr);
}
/*
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
* Method: getPDPVoltage
* Signature: (Ljava/nio/IntBuffer;)D
*/
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPVoltage
(JNIEnv *env, jclass, jobject status)
{
jint *status_ptr = (jint *)env->GetDirectBufferAddress(status);
return getPDPVoltage(status_ptr);
}
/*
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
* Method: getPDPChannelCurrent
* Signature: (BLjava/nio/IntBuffer;)D
*/
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPChannelCurrent
(JNIEnv *env, jclass, jbyte channel, jobject status)
{
jint *status_ptr = (jint *)env->GetDirectBufferAddress(status);
return getPDPChannelCurrent(channel, status_ptr);
}

View File

@@ -4,7 +4,7 @@
#include "edu_wpi_first_wpilibj_hal_SolenoidJNI.h"
TLogLevel solenoidJNILogLevel = logWARNING;
TLogLevel solenoidJNILogLevel = logERROR;
#define SOLENOIDJNI_LOG(level) \
if (level > solenoidJNILogLevel) ; \

View File

@@ -124,6 +124,7 @@ this default location, specify a value for the 'embeddedJDKHome' property at the
<javahClassName>edu.wpi.first.wpilibj.hal.SPIJNI</javahClassName>
<javahClassName>edu.wpi.first.wpilibj.hal.SolenoidJNI</javahClassName>
<javahClassName>edu.wpi.first.wpilibj.hal.CompressorJNI</javahClassName>
<javahClassName>edu.wpi.first.wpilibj.hal.PDPJNI</javahClassName>
</javahClassNames>
<!-- enable additional javah interface in dependencies list -->
<!-- javahSearchJNIFromDependencies>true</javahSearchJNIFromDependencies -->