2016-01-02 03:02:34 -08:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
|
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
2014-07-21 10:07:46 -04:00
|
|
|
#include <jni.h>
|
|
|
|
|
#include "edu_wpi_first_wpilibj_hal_AccelerometerJNI.h"
|
|
|
|
|
#include "HAL/Accelerometer.hpp"
|
|
|
|
|
|
2015-11-01 09:11:52 -08:00
|
|
|
extern "C" {
|
|
|
|
|
|
2014-07-21 10:07:46 -04:00
|
|
|
/*
|
|
|
|
|
* Class: edu_wpi_first_wpilibj_hal_AccelerometerJNI
|
|
|
|
|
* Method: setAccelerometerActive
|
|
|
|
|
* Signature: (Z)V
|
|
|
|
|
*/
|
|
|
|
|
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerActive
|
|
|
|
|
(JNIEnv *, jclass, jboolean active)
|
|
|
|
|
{
|
|
|
|
|
setAccelerometerActive(active);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Class: edu_wpi_first_wpilibj_hal_AccelerometerJNI
|
|
|
|
|
* Method: setAccelerometerRange
|
|
|
|
|
* Signature: (I)V
|
|
|
|
|
*/
|
|
|
|
|
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerRange
|
|
|
|
|
(JNIEnv *, jclass, jint range)
|
|
|
|
|
{
|
|
|
|
|
setAccelerometerRange((AccelerometerRange)range);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Class: edu_wpi_first_wpilibj_hal_AccelerometerJNI
|
|
|
|
|
* Method: getAccelerometerX
|
|
|
|
|
* Signature: ()D
|
|
|
|
|
*/
|
|
|
|
|
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerX
|
|
|
|
|
(JNIEnv *, jclass)
|
|
|
|
|
{
|
|
|
|
|
return getAccelerometerX();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Class: edu_wpi_first_wpilibj_hal_AccelerometerJNI
|
|
|
|
|
* Method: getAccelerometerY
|
|
|
|
|
* Signature: ()D
|
|
|
|
|
*/
|
|
|
|
|
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerY
|
|
|
|
|
(JNIEnv *, jclass)
|
|
|
|
|
{
|
|
|
|
|
return getAccelerometerY();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Class: edu_wpi_first_wpilibj_hal_AccelerometerJNI
|
|
|
|
|
* Method: getAccelerometerZ
|
|
|
|
|
* Signature: ()D
|
|
|
|
|
*/
|
|
|
|
|
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerZ
|
|
|
|
|
(JNIEnv *, jclass)
|
|
|
|
|
{
|
|
|
|
|
return getAccelerometerZ();
|
|
|
|
|
}
|
2015-11-01 09:11:52 -08:00
|
|
|
|
|
|
|
|
} // extern "C"
|