mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal, wpilib] Remove digital source from encoder (#7740)
This commit is contained in:
@@ -18,21 +18,17 @@ extern "C" {
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_EncoderJNI
|
||||
* Method: initializeEncoder
|
||||
* Signature: (IIIIZI)I
|
||||
* Signature: (IIZI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_EncoderJNI_initializeEncoder
|
||||
(JNIEnv* env, jclass, jint digitalSourceHandleA, jint analogTriggerTypeA,
|
||||
jint digitalSourceHandleB, jint analogTriggerTypeB,
|
||||
jboolean reverseDirection, jint encodingType)
|
||||
(JNIEnv* env, jclass, jint aChannel, jint bChannel, jboolean reverseDirection,
|
||||
jint encodingType)
|
||||
{
|
||||
int32_t status = 0;
|
||||
auto encoder = HAL_InitializeEncoder(
|
||||
(HAL_Handle)digitalSourceHandleA,
|
||||
(HAL_AnalogTriggerType)analogTriggerTypeA,
|
||||
(HAL_Handle)digitalSourceHandleB,
|
||||
(HAL_AnalogTriggerType)analogTriggerTypeB, reverseDirection,
|
||||
(HAL_EncoderEncodingType)encodingType, &status);
|
||||
auto encoder =
|
||||
HAL_InitializeEncoder(aChannel, bChannel, reverseDirection,
|
||||
(HAL_EncoderEncodingType)encodingType, &status);
|
||||
CheckStatusForceThrow(env, status);
|
||||
return (jint)encoder;
|
||||
}
|
||||
@@ -286,24 +282,6 @@ Java_edu_wpi_first_hal_EncoderJNI_getEncoderSamplesToAverage
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_EncoderJNI
|
||||
* Method: setEncoderIndexSource
|
||||
* Signature: (IIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_EncoderJNI_setEncoderIndexSource
|
||||
(JNIEnv* env, jclass, jint id, jint digitalSourceHandle,
|
||||
jint analogTriggerType, jint type)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_SetEncoderIndexSource((HAL_EncoderHandle)id,
|
||||
(HAL_Handle)digitalSourceHandle,
|
||||
(HAL_AnalogTriggerType)analogTriggerType,
|
||||
(HAL_EncoderIndexingType)type, &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_EncoderJNI
|
||||
* Method: getEncoderFPGAIndex
|
||||
|
||||
Reference in New Issue
Block a user