/** * Configure the analog trigger to use the averaged vs. raw values. * If the value is true, then the averaged value is selected for the analog trigger, otherwise * the immediate value is used. * @param useAveragedValue If true, use the Averaged value, otherwise use the instantaneous reading */ void AnalogTrigger::SetAveraged(bool useAveragedValue) { if (StatusIsFatal()) return; int32_t status = 0; setAnalogTriggerAveraged(m_trigger, useAveragedValue, &status); wpi_setErrorWithContext(status, getHALErrorMessage(status)); }
/* * Class: edu_wpi_first_wpilibj_hal_AnalogJNI * Method: setAnalogTriggerAveraged * Signature: (Ljava/nio/ByteBuffer;BLjava/nio/IntBuffer;)V */ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerAveraged (JNIEnv * env, jclass, jobject id, jbyte averaged, 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; setAnalogTriggerAveraged( *javaId, averaged, statusPtr ); }