Switches HAL to fixed length signed integers, and adds our own HAL_Bool Type (#155)

* Switches HAL to fixed length signed integers, and adds our own HAL_Bool type

* Replaces HAL Floats with Doubles

Doubles are just as fast as floats with optimizations turned on, so
switches to all doubles. All made doubles for consistency.

* Prepends HAL/ to HAL include files. Also fixes some range errors
This commit is contained in:
Thad House
2016-07-12 10:45:14 -07:00
committed by Peter Johnson
parent 4a98e68815
commit b51e85ae26
89 changed files with 900 additions and 795 deletions

View File

@@ -295,12 +295,12 @@ public class AnalogInput extends SensorBase implements PIDSource, LiveWindowSend
ByteBuffer value = ByteBuffer.allocateDirect(8);
// set the byte order
value.order(ByteOrder.LITTLE_ENDIAN);
ByteBuffer count = ByteBuffer.allocateDirect(4);
ByteBuffer count = ByteBuffer.allocateDirect(8);
// set the byte order
count.order(ByteOrder.LITTLE_ENDIAN);
AnalogJNI.getAccumulatorOutput(m_port, value.asLongBuffer(), count.asIntBuffer());
AnalogJNI.getAccumulatorOutput(m_port, value.asLongBuffer(), count.asLongBuffer());
result.value = value.asLongBuffer().get(0) + m_accumulatorOffset;
result.count = count.asIntBuffer().get(0);
result.count = count.asLongBuffer().get(0);
}
/**

View File

@@ -365,11 +365,11 @@ public class SPI extends SensorBase {
ByteBuffer value = ByteBuffer.allocateDirect(8);
// set the byte order
value.order(ByteOrder.LITTLE_ENDIAN);
ByteBuffer count = ByteBuffer.allocateDirect(4);
ByteBuffer count = ByteBuffer.allocateDirect(8);
// set the byte order
count.order(ByteOrder.LITTLE_ENDIAN);
SPIJNI.spiGetAccumulatorOutput(m_port, value.asLongBuffer(), count.asIntBuffer());
SPIJNI.spiGetAccumulatorOutput(m_port, value.asLongBuffer(), count.asLongBuffer());
result.value = value.asLongBuffer().get(0);
result.count = count.asIntBuffer().get(0);
result.count = count.asLongBuffer().get(0);
}
}

View File

@@ -92,7 +92,7 @@ public class AnalogJNI extends JNIWrapper {
public static native int getAccumulatorCount(int analogPortHandle);
public static native void getAccumulatorOutput(int analogPortHandle, LongBuffer value,
IntBuffer count);
LongBuffer count);
public static native int initializeAnalogTrigger(int analogInputHandle, IntBuffer index);

View File

@@ -54,5 +54,5 @@ public class SPIJNI extends JNIWrapper {
public static native double spiGetAccumulatorAverage(byte port);
public static native void spiGetAccumulatorOutput(byte port, LongBuffer value,
IntBuffer count);
LongBuffer count);
}