/** * Configure the analog trigger to use a filtered value. * The analog trigger will operate with a 3 point average rejection filter. This is designed to * help with 360 degree pot applications for the period where the pot crosses through zero. * @param useFilteredValue If true, use the 3 point rejection filter, otherwise use the unfiltered value */ void AnalogTrigger::SetFiltered(bool useFilteredValue) { if (StatusIsFatal()) return; int32_t status = 0; setAnalogTriggerFiltered(m_trigger, useFilteredValue, &status); wpi_setErrorWithContext(status, getHALErrorMessage(status)); }
/* * Class: edu_wpi_first_wpilibj_hal_AnalogJNI * Method: setAnalogTriggerFiltered * Signature: (Ljava/nio/ByteBuffer;BLjava/nio/IntBuffer;)V */ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerFiltered (JNIEnv * env, jclass, jobject id, jbyte filtered, jobject status){ void ** javaId = (void**)env->GetDirectBufferAddress(id); ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Ptr = " << *javaId; jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); ANALOGJNI_LOG(logDEBUG) << "Status Ptr = " << statusPtr; setAnalogTriggerFiltered( *javaId, filtered, statusPtr ); }