Removed modules from the HAL and JNI bindings

Modules aren't used anymore in wpilibc and wpilibj, so the hal functions
that references them and and JNI bindings for these functions have been
pulled out.

Both Counter classes were also modified because they still referenced
modules.

Change-Id: Ic01feb145a4ed5f08cd55f140867c721f5ee7b10
This commit is contained in:
Thomas Clark
2014-08-01 15:00:41 -04:00
parent fd4379a946
commit 792e3b6ccc
14 changed files with 103 additions and 422 deletions

View File

@@ -241,8 +241,7 @@ public class Counter extends SensorBase implements CounterBase,
m_upSource = source;
ByteBuffer status = ByteBuffer.allocateDirect(4);
status.order(ByteOrder.LITTLE_ENDIAN);
CounterJNI.setCounterUpSourceWithModule(m_counter,
(byte) source.getModuleForRouting(),
CounterJNI.setCounterUpSource(m_counter,
source.getChannelForRouting(),
(byte) (source.getAnalogTriggerForRouting() ? 1 : 0), status.asIntBuffer());
HALUtil.checkStatus(status.asIntBuffer());
@@ -333,8 +332,7 @@ public class Counter extends SensorBase implements CounterBase,
}
ByteBuffer status = ByteBuffer.allocateDirect(4);
status.order(ByteOrder.LITTLE_ENDIAN);
CounterJNI.setCounterDownSourceWithModule(m_counter,
(byte) source.getModuleForRouting(),
CounterJNI.setCounterDownSource(m_counter,
source.getChannelForRouting(),
(byte) (source.getAnalogTriggerForRouting() ? 1 : 0), status.asIntBuffer());
if (status.asIntBuffer().get(0) == HALUtil.PARAMETER_OUT_OF_RANGE) {

View File

@@ -29,8 +29,6 @@ public class AnalogJNI extends JNIWrapper {
public static native double getAnalogOutput(ByteBuffer port_pointer, IntBuffer status);
public static native void setAnalogSampleRate(double samplesPerSecond, IntBuffer status);
public static native double getAnalogSampleRate(IntBuffer status);
public static native void setAnalogSampleRateWithModule(byte module, double samplesPerSecond, IntBuffer status);
public static native double getAnalogSampleRateWithModule(byte module, IntBuffer status);
public static native void setAnalogAverageBits(ByteBuffer analog_port_pointer, int bits, IntBuffer status);
public static native int getAnalogAverageBits(ByteBuffer analog_port_pointer, IntBuffer status);
public static native void setAnalogOversampleBits(ByteBuffer analog_port_pointer, int bits, IntBuffer status);

View File

@@ -7,10 +7,10 @@ public class CounterJNI extends JNIWrapper {
public static native ByteBuffer initializeCounter(int mode, IntBuffer index, IntBuffer status);
public static native void freeCounter(ByteBuffer counter_pointer, IntBuffer status);
public static native void setCounterAverageSize(ByteBuffer counter_pointer, int size, IntBuffer status);
public static native void setCounterUpSourceWithModule(ByteBuffer counter_pointer, byte module, int pin, byte analogTrigger, IntBuffer status);
public static native void setCounterUpSource(ByteBuffer counter_pointer, int pin, byte analogTrigger, IntBuffer status);
public static native void setCounterUpSourceEdge(ByteBuffer counter_pointer, byte risingEdge, byte fallingEdge, IntBuffer status);
public static native void clearCounterUpSource(ByteBuffer counter_pointer, IntBuffer status);
public static native void setCounterDownSourceWithModule(ByteBuffer counter_pointer, byte module, int pin, byte analogTrigger, IntBuffer status);
public static native void setCounterDownSource(ByteBuffer counter_pointer, int pin, byte analogTrigger, IntBuffer status);
public static native void setCounterDownSourceEdge(ByteBuffer counter_pointer, byte risingEdge, byte fallingEdge, IntBuffer status);
public static native void clearCounterDownSource(ByteBuffer counter_pointer, IntBuffer status);
public static native void setCounterUpDownMode(ByteBuffer counter_pointer, IntBuffer status);

View File

@@ -10,13 +10,8 @@ public class DIOJNI extends JNIWrapper {
public static native void setDIO(ByteBuffer digital_port_pointer, short value, IntBuffer status);
public static native byte getDIO(ByteBuffer digital_port_pointer, IntBuffer status);
public static native byte getDIODirection(ByteBuffer digital_port_pointer, IntBuffer status);
//public static native byte remapDigitalChannel(int pin, IntBuffer status);
//public static native byte unmapDigitalChannel(int pin, IntBuffer status);
public static native byte checkDigitalModule(byte module);
public static native void pulse(ByteBuffer digital_port_pointer, double pulseLength, IntBuffer status);
public static native byte isPulsing(ByteBuffer digital_port_pointer, IntBuffer status);
public static native byte isAnyPulsing(IntBuffer status);
public static native byte isAnyPulsingWithModule(byte module, IntBuffer status);
public static native short getLoopTiming(IntBuffer status);
public static native short getLoopTimingWithModule(byte module, IntBuffer status);
}

View File

@@ -11,13 +11,8 @@ public class PWMJNI extends DIOJNI {
public static native short getPWM(ByteBuffer digital_port_pointer, IntBuffer status);
public static native void setPWMPeriodScale(ByteBuffer digital_port_pointer, int squelchMask, IntBuffer status);
public static native ByteBuffer allocatePWM(IntBuffer status);
public static native ByteBuffer allocatePWMWithModule(byte module, IntBuffer status);
public static native void freePWM(ByteBuffer pwmGenerator, IntBuffer status);
public static native void freePWMWithModule(byte module, ByteBuffer pwmGenerator, IntBuffer status);
public static native void setPWMRate(double rate, IntBuffer status);
public static native void setPWMRateWithModule(byte module, double rate, IntBuffer status);
public static native void setPWMDutyCycle(ByteBuffer pwmGenerator, double dutyCycle, IntBuffer status);
public static native void setPWMDutyCycleWithModule(byte module, ByteBuffer pwmGenerator, double dutyCycle, IntBuffer status);
public static native void setPWMOutputChannel(ByteBuffer pwmGenerator, int pin, IntBuffer status);
public static native void setPWMOutputChannelWithModule(byte module, ByteBuffer pwmGenerator, int pin, IntBuffer status);
}