forked from Open-RIO/ToastAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial support for encoders in simulation closes Open-RIO#35
- Loading branch information
1 parent
511fd09
commit f787b85
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
patches/src/main/java/edu/wpi/first/wpilibj/hal/EncoderJNI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package edu.wpi.first.wpilibj.hal; | ||
|
||
import java.nio.IntBuffer; | ||
|
||
/** | ||
* JNIWrapper for encoders | ||
*/ | ||
public class EncoderJNI extends JNIWrapper { | ||
|
||
public static long initializeEncoder(byte port_a_module, int port_a_pin, | ||
boolean port_a_analog_trigger, byte port_b_module, int port_b_pin, boolean port_b_analog_trigger, | ||
boolean reverseDirection, IntBuffer index){ | ||
return 0; | ||
} | ||
|
||
public static void freeEncoder(long encoder_pointer){ | ||
} | ||
|
||
public static void resetEncoder(long encoder_pointer){ | ||
} | ||
|
||
public static int getEncoder(long encoder_pointer){ | ||
return 0; | ||
} | ||
|
||
public static double getEncoderPeriod(long encoder_pointer){ | ||
return 0; | ||
} | ||
|
||
public static void setEncoderMaxPeriod(long encoder_pointer, double maxPeriod){ | ||
} | ||
|
||
public static boolean getEncoderStopped(long encoder_pointer){ | ||
return false; | ||
} | ||
|
||
public static boolean getEncoderDirection(long encoder_pointer){ | ||
return false; | ||
} | ||
|
||
public static void setEncoderReverseDirection(long encoder_pointer, | ||
boolean reverseDirection){ | ||
} | ||
|
||
public static void setEncoderSamplesToAverage(long encoder_pointer, | ||
int samplesToAverage){ | ||
} | ||
|
||
public static int getEncoderSamplesToAverage(long encoder_pointer){ | ||
return 0; | ||
} | ||
|
||
public static void setEncoderIndexSource(long digital_port, int pin, | ||
boolean analogTrigger, boolean activeHigh, boolean edgeSensitive){ | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters