Ejemplo n.º 1
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
 * Method:    getAnalogSampleRate
 * Signature: (Ljava/nio/IntBuffer;)D
 */
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogSampleRate
  (JNIEnv * env, jclass, jobject status)
{
	jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
	double returnValue = getAnalogSampleRate( statusPtr );
	ANALOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr;
	ANALOGJNI_LOG(logDEBUG) << "SampleRate = " << returnValue;
	return returnValue;
}
Ejemplo n.º 2
0
//// Float JNA Hack
// Float
int getAnalogSampleRateIntHack(int32_t *status) {
  return floatToInt(getAnalogSampleRate(status));
}
Ejemplo n.º 3
0
/**
 * Get the current sample rate for all channels
 *
 * @return Sample rate.
 */
float AnalogInput::GetSampleRate() {
    int32_t status = 0;
    float sampleRate = getAnalogSampleRate(&status);
    wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
    return sampleRate;
}