Fixed access issues and 'overridableParamatar' misspelling.

interruptFired was package-private, which meant that it couldn't be
used... at all. Oops! Also, fixed obvious misspelling of
overridableParamatar, which probably won't hurt anyone because they
couldn't have used interruptFired anyway...

Change-Id: I6c57c015d04cde31f5be92265db1d1d9ba0760c9
This commit is contained in:
Colby Skeggs
2015-04-09 16:29:14 -07:00
parent 0dffbd8634
commit 569f02de89
3 changed files with 8 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ import edu.wpi.first.wpilibj.hal.InterruptJNI.InterruptJNIHandlerFunction;
* @param <T> The type of the parameter that should be returned to the the
* method {@link #interruptFired(int, Object)}
*/
public abstract class InterruptHandlerFunction<T>{
public abstract class InterruptHandlerFunction<T> {
/**
* The entry point for the interrupt. When the interrupt fires the
* {@link #apply(int, Object)} method is called.
@@ -26,7 +26,7 @@ public abstract class InterruptHandlerFunction<T>{
* pass a generic object to the interrupt fired method.
* @author Jonathan Leitschuh
*/
private class Function implements InterruptJNIHandlerFunction{
private class Function implements InterruptJNIHandlerFunction {
@SuppressWarnings("unchecked")
@Override
public void apply(int interruptAssertedMask, Object param) {
@@ -38,10 +38,10 @@ public abstract class InterruptHandlerFunction<T>{
/**
* This method is run every time an interrupt is fired.
* @param interruptAssertedMask
* @param param The parameter provided by overriding the {@link #overridableParamater()}
* @param param The parameter provided by overriding the {@link #overridableParameter()}
* method.
*/
abstract void interruptFired(int interruptAssertedMask, T param);
public abstract void interruptFired(int interruptAssertedMask, T param);
/**
@@ -51,7 +51,7 @@ public abstract class InterruptHandlerFunction<T>{
* is run.
* @return The object that should be passed to the interrupt when it runs
*/
public T overridableParamater(){
public T overridableParameter() {
return null;
}
}

View File

@@ -100,7 +100,7 @@ public abstract class InterruptableSensorBase extends SensorBase {
(byte) (getAnalogTriggerForRouting() ? 1 : 0), status.asIntBuffer());
HALUtil.checkStatus(status.asIntBuffer());
setUpSourceEdge(true, false);
InterruptJNI.attachInterruptHandler(m_interrupt, handler.function, handler.overridableParamater(), status.asIntBuffer());
InterruptJNI.attachInterruptHandler(m_interrupt, handler.function, handler.overridableParameter(), status.asIntBuffer());
HALUtil.checkStatus(status.asIntBuffer());
}