/**
 * Set the upper and lower limits of the analog trigger.
 * The limits are given in ADC codes.  If oversampling is used, the units must be scaled
 * appropriately.
 * @param lower The lower limit of the trigger in ADC codes (12-bit values).
 * @param upper The upper limit of the trigger in ADC codes (12-bit values).
 */
void AnalogTrigger::SetLimitsRaw(int32_t lower, int32_t upper)
{
	if (StatusIsFatal()) return;
	int32_t status = 0;
	setAnalogTriggerLimitsRaw(m_trigger, lower, upper, &status);
	wpi_setErrorWithContext(status, getHALErrorMessage(status));
}
Example #2
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
 * Method:    setAnalogTriggerLimitsRaw
 * Signature: (Ljava/nio/ByteBuffer;IILjava/nio/IntBuffer;)V
 */
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerLimitsRaw
  (JNIEnv * env, jclass, jobject id, jint lower, jint upper, 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;

	setAnalogTriggerLimitsRaw( *javaId, lower, upper, statusPtr );
}