mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Switches Counters to Handles (#123)
This commit is contained in:
committed by
Peter Johnson
parent
47694ef810
commit
0f105a26f7
@@ -29,9 +29,9 @@ extern "C" {
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: initializeCounter
|
||||
* Signature: (ILjava/nio/IntBuffer;)J
|
||||
* Signature: (ILjava/nio/IntBuffer;)I
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_initializeCounter(
|
||||
JNIEnv* env, jclass, jint mode, jobject index) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI initializeCounter";
|
||||
@@ -39,25 +39,25 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_initializeCounter(
|
||||
jint* indexPtr = (jint*)env->GetDirectBufferAddress(index);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Index Ptr = " << (uint32_t*)indexPtr;
|
||||
int32_t status = 0;
|
||||
void* counter = initializeCounter((Mode)mode, (uint32_t*)indexPtr, &status);
|
||||
auto counter = initializeCounter((Mode)mode, (uint32_t*)indexPtr, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Index = " << *indexPtr;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
COUNTERJNI_LOG(logDEBUG) << "COUNTER Ptr = " << counter;
|
||||
COUNTERJNI_LOG(logDEBUG) << "COUNTER Handle = " << counter;
|
||||
CheckStatus(env, status);
|
||||
return (jlong)counter;
|
||||
return (jint)counter;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: freeCounter
|
||||
* Signature: (J)V
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_freeCounter(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI freeCounter";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
freeCounter((void*)id, &status);
|
||||
freeCounter((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -65,16 +65,16 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_freeCounter(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterAverageSize
|
||||
* Signature: (JI)V
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterAverageSize(
|
||||
JNIEnv* env, jclass, jlong id, jint value) {
|
||||
JNIEnv* env, jclass, jint id, jint value) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterAverageSize";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "AverageSize = " << value;
|
||||
int32_t status = 0;
|
||||
setCounterAverageSize((void*)id, value, &status);
|
||||
setCounterAverageSize((HalCounterHandle)id, value, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -82,17 +82,17 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterAverageSize(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterUpSource
|
||||
* Signature: (JIZ)V
|
||||
* Signature: (IIZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSource(
|
||||
JNIEnv* env, jclass, jlong id, jint pin, jboolean analogTrigger) {
|
||||
JNIEnv* env, jclass, jint id, jint pin, jboolean analogTrigger) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterUpSource";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Pin = " << pin;
|
||||
COUNTERJNI_LOG(logDEBUG) << "AnalogTrigger = " << (jint)analogTrigger;
|
||||
int32_t status = 0;
|
||||
setCounterUpSource((void*)id, pin, analogTrigger, &status);
|
||||
setCounterUpSource((HalCounterHandle)id, pin, analogTrigger, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -100,17 +100,17 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSource(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterUpSourceEdge
|
||||
* Signature: (JZZ)V
|
||||
* Signature: (IZZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSourceEdge(
|
||||
JNIEnv* env, jclass, jlong id, jboolean valueRise, jboolean valueFall) {
|
||||
JNIEnv* env, jclass, jint id, jboolean valueRise, jboolean valueFall) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterUpSourceEdge";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Rise = " << (jint)valueRise;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Fall = " << (jint)valueFall;
|
||||
int32_t status = 0;
|
||||
setCounterUpSourceEdge((void*)id, valueRise, valueFall, &status);
|
||||
setCounterUpSourceEdge((HalCounterHandle)id, valueRise, valueFall, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -118,15 +118,15 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSourceEdge(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: clearCounterUpSource
|
||||
* Signature: (J)V
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterUpSource(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI clearCounterUpSource";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
clearCounterUpSource((void*)id, &status);
|
||||
clearCounterUpSource((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -134,17 +134,17 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterUpSource(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterDownSource
|
||||
* Signature: (JIZ)V
|
||||
* Signature: (IIZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSource(
|
||||
JNIEnv* env, jclass, jlong id, jint pin, jboolean analogTrigger) {
|
||||
JNIEnv* env, jclass, jint id, jint pin, jboolean analogTrigger) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterDownSource";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Pin = " << pin;
|
||||
COUNTERJNI_LOG(logDEBUG) << "AnalogTrigger = " << (jint)analogTrigger;
|
||||
int32_t status = 0;
|
||||
setCounterDownSource((void*)id, pin, analogTrigger, &status);
|
||||
setCounterDownSource((HalCounterHandle)id, pin, analogTrigger, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
if (status == PARAMETER_OUT_OF_RANGE) {
|
||||
ThrowIllegalArgumentException(env,
|
||||
@@ -158,17 +158,17 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSource(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterDownSourceEdge
|
||||
* Signature: (JZZ)V
|
||||
* Signature: (IZZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSourceEdge(
|
||||
JNIEnv* env, jclass, jlong id, jboolean valueRise, jboolean valueFall) {
|
||||
JNIEnv* env, jclass, jint id, jboolean valueRise, jboolean valueFall) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterDownSourceEdge";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Rise = " << (jint)valueRise;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Fall = " << (jint)valueFall;
|
||||
int32_t status = 0;
|
||||
setCounterDownSourceEdge((void*)id, valueRise, valueFall, &status);
|
||||
setCounterDownSourceEdge((HalCounterHandle)id, valueRise, valueFall, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -176,15 +176,15 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSourceEdge(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: clearCounterDownSource
|
||||
* Signature: (J)V
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterDownSource(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI clearCounterDownSource";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
clearCounterDownSource((void*)id, &status);
|
||||
clearCounterDownSource((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -192,15 +192,15 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterDownSource(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterUpDownMode
|
||||
* Signature: (J)V
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpDownMode(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterUpDownMode";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
setCounterUpDownMode((void*)id, &status);
|
||||
setCounterUpDownMode((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -208,16 +208,16 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpDownMode(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterExternalDirectionMode
|
||||
* Signature: (J)V
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterExternalDirectionMode(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG)
|
||||
<< "Calling COUNTERJNI setCounterExternalDirectionMode";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
setCounterExternalDirectionMode((void*)id, &status);
|
||||
setCounterExternalDirectionMode((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -225,16 +225,16 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterExternalDirectionMode(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterSemiPeriodMode
|
||||
* Signature: (JZ)V
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSemiPeriodMode(
|
||||
JNIEnv* env, jclass, jlong id, jboolean value) {
|
||||
JNIEnv* env, jclass, jint id, jboolean value) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterSemiPeriodMode";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "SemiPeriodMode = " << (jint)value;
|
||||
int32_t status = 0;
|
||||
setCounterSemiPeriodMode((void*)id, value, &status);
|
||||
setCounterSemiPeriodMode((HalCounterHandle)id, value, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -242,16 +242,16 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSemiPeriodMode(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterPulseLengthMode
|
||||
* Signature: (JD)V
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterPulseLengthMode(
|
||||
JNIEnv* env, jclass, jlong id, jdouble value) {
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterPulseLengthMode";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "PulseLengthMode = " << value;
|
||||
int32_t status = 0;
|
||||
setCounterPulseLengthMode((void*)id, value, &status);
|
||||
setCounterPulseLengthMode((HalCounterHandle)id, value, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -259,15 +259,15 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterPulseLengthMode(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: getCounterSamplesToAverage
|
||||
* Signature: (J)I
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterSamplesToAverage(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterSamplesToAverage";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = getCounterSamplesToAverage((void*)id, &status);
|
||||
jint returnValue = getCounterSamplesToAverage((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
COUNTERJNI_LOG(logDEBUG) << "getCounterSamplesToAverageResult = "
|
||||
<< returnValue;
|
||||
@@ -278,16 +278,16 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterSamplesToAverage(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterSamplesToAverage
|
||||
* Signature: (JI)V
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSamplesToAverage(
|
||||
JNIEnv* env, jclass, jlong id, jint value) {
|
||||
JNIEnv* env, jclass, jint id, jint value) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterSamplesToAverage";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "SamplesToAverage = " << value;
|
||||
int32_t status = 0;
|
||||
setCounterSamplesToAverage((void*)id, value, &status);
|
||||
setCounterSamplesToAverage((HalCounterHandle)id, value, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
if (status == PARAMETER_OUT_OF_RANGE) {
|
||||
ThrowBoundaryException(env, value, 1, 127);
|
||||
@@ -299,14 +299,14 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSamplesToAverage(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: resetCounter
|
||||
* Signature: (J)V
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_resetCounter(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI resetCounter";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
resetCounter((void*)id, &status);
|
||||
resetCounter((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -314,14 +314,14 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_resetCounter(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: getCounter
|
||||
* Signature: (J)I
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounter(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
// COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounter";
|
||||
// COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
// COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = getCounter((void*)id, &status);
|
||||
jint returnValue = getCounter((HalCounterHandle)id, &status);
|
||||
// COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
// COUNTERJNI_LOG(logDEBUG) << "getCounterResult = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -331,15 +331,15 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounter(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: getCounterPeriod
|
||||
* Signature: (J)D
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterPeriod(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterPeriod";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
jdouble returnValue = getCounterPeriod((void*)id, &status);
|
||||
jdouble returnValue = getCounterPeriod((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
COUNTERJNI_LOG(logDEBUG) << "getCounterPeriodResult = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -349,16 +349,16 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterPeriod(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterMaxPeriod
|
||||
* Signature: (JD)V
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterMaxPeriod(
|
||||
JNIEnv* env, jclass, jlong id, jdouble value) {
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterMaxPeriod";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "MaxPeriod = " << value;
|
||||
int32_t status = 0;
|
||||
setCounterMaxPeriod((void*)id, value, &status);
|
||||
setCounterMaxPeriod((HalCounterHandle)id, value, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -366,16 +366,16 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterMaxPeriod(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterUpdateWhenEmpty
|
||||
* Signature: (JZ)V
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpdateWhenEmpty(
|
||||
JNIEnv* env, jclass, jlong id, jboolean value) {
|
||||
JNIEnv* env, jclass, jint id, jboolean value) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterMaxPeriod";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "UpdateWhenEmpty = " << (jint)value;
|
||||
int32_t status = 0;
|
||||
setCounterUpdateWhenEmpty((void*)id, value, &status);
|
||||
setCounterUpdateWhenEmpty((HalCounterHandle)id, value, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -383,15 +383,15 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpdateWhenEmpty(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: getCounterStopped
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterStopped(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterStopped";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
jboolean returnValue = getCounterStopped((void*)id, &status);
|
||||
jboolean returnValue = getCounterStopped((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
COUNTERJNI_LOG(logDEBUG) << "getCounterStoppedResult = " << (jint)returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -401,15 +401,15 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterStopped(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: getCounterDirection
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterDirection(
|
||||
JNIEnv* env, jclass, jlong id) {
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterDirection";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
int32_t status = 0;
|
||||
jboolean returnValue = getCounterDirection((void*)id, &status);
|
||||
jboolean returnValue = getCounterDirection((HalCounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
COUNTERJNI_LOG(logDEBUG) << "getCounterDirectionResult = "
|
||||
<< (jint)returnValue;
|
||||
@@ -420,16 +420,16 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterDirection(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterReverseDirection
|
||||
* Signature: (JZ)V
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterReverseDirection(
|
||||
JNIEnv* env, jclass, jlong id, jboolean value) {
|
||||
JNIEnv* env, jclass, jint id, jboolean value) {
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterReverseDirection";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Ptr = " << (void*)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HalCounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "ReverseDirection = " << (jint)value;
|
||||
int32_t status = 0;
|
||||
setCounterReverseDirection((void*)id, value, &status);
|
||||
setCounterReverseDirection((HalCounterHandle)id, value, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user