Skip to content

Commit

Permalink
java
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Turner <[email protected]>
  • Loading branch information
spacey-sooty committed Dec 19, 2024
1 parent 2b699b0 commit 7066ea9
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ public static AllianceStationID getRawAllianceStation() {
* @return true if connected, false if timeout
*/
public static boolean waitForDsConnection(double timeoutSeconds) {
int event = WPIUtilJNI.createEvent(true, false);
int event = WPIUtilJNI.makeEvent(true, false);
DriverStationJNI.provideNewDataEventHandle(event);
boolean result;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class MotorSafety {

@SuppressWarnings("PMD.AssignmentInOperand")
private static void threadMain() {
int event = WPIUtilJNI.createEvent(false, false);
int event = WPIUtilJNI.makeEvent(false, false);
DriverStationJNI.provideNewDataEventHandle(event);
ControlWord controlWord = new ControlWord();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public DriverStationModeThread() {
}

private void run() {
int handle = WPIUtilJNI.createEvent(false, false);
int handle = WPIUtilJNI.makeEvent(false, false);
DriverStationJNI.provideNewDataEventHandle(handle);

while (m_keepAlive.get()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public static void setMatchTime(double matchTime) {

/** Updates DriverStation data so that new values are visible to the user program. */
public static void notifyNewData() {
int handle = WPIUtilJNI.createEvent(false, false);
int handle = WPIUtilJNI.makeEvent(false, false);
DriverStationJNI.provideNewDataEventHandle(handle);
DriverStationDataJNI.notifyNewData();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void test() {
public void startCompetition() {
DriverStationModeThread modeThread = new DriverStationModeThread();

int event = WPIUtilJNI.createEvent(false, false);
int event = WPIUtilJNI.makeEvent(false, false);

DriverStation.provideRefreshedDataEventHandle(event);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void test() {}
public void startCompetition() {
DriverStationModeThread modeThread = new DriverStationModeThread();

int event = WPIUtilJNI.createEvent(false, false);
int event = WPIUtilJNI.makeEvent(false, false);

DriverStation.provideRefreshedDataEventHandle(event);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void test() {
public void startCompetition() {
DriverStationModeThread modeThread = new DriverStationModeThread();

int event = WPIUtilJNI.createEvent(false, false);
int event = WPIUtilJNI.makeEvent(false, false);

DriverStation.provideRefreshedDataEventHandle(event);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void test() {
public void startCompetition() {
DriverStationModeThread modeThread = new DriverStationModeThread();

int event = WPIUtilJNI.createEvent(false, false);
int event = WPIUtilJNI.makeEvent(false, false);

DriverStation.provideRefreshedDataEventHandle(event);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected Logger getClassLogger() {
public void waitForDataTest() {
long startTime = RobotController.getFPGATime();

int handle = WPIUtilJNI.createEvent(false, false);
int handle = WPIUtilJNI.makeEvent(false, false);
DriverStationJNI.provideNewDataEventHandle(handle);

// Wait for data 50 times
Expand Down
4 changes: 2 additions & 2 deletions wpiutil/src/main/java/edu/wpi/first/util/WPIUtilJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static synchronized void forceLoad() throws IOException {
* @param initialState true to make the event initially in signaled state
* @return Event handle
*/
public static native int createEvent(boolean manualReset, boolean initialState);
public static native int makeEvent(boolean manualReset, boolean initialState);

/**
* Destroys an event. Destruction wakes up any waiters.
Expand Down Expand Up @@ -144,7 +144,7 @@ public static synchronized void forceLoad() throws IOException {
* @param maximumCount maximum value for the semaphore's internal counter
* @return Semaphore handle
*/
public static native int createSemaphore(int initialCount, int maximumCount);
public static native int makeSemaphore(int initialCount, int maximumCount);

/**
* Destroys a semaphore. Destruction wakes up any waiters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final class Event implements AutoCloseable {
* @param initialState true to make the event initially in signaled state
*/
public Event(boolean manualReset, boolean initialState) {
m_handle = WPIUtilJNI.createEvent(manualReset, initialState);
m_handle = WPIUtilJNI.makeEvent(manualReset, initialState);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class Semaphore implements AutoCloseable {
* @param maximumCount maximum value for the semaphore's internal counter
*/
public Semaphore(int initialCount, int maximumCount) {
m_handle = WPIUtilJNI.createSemaphore(initialCount, maximumCount);
m_handle = WPIUtilJNI.makeSemaphore(initialCount, maximumCount);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ Java_edu_wpi_first_util_WPIUtilJNI_getSystemTime

/*
* Class: edu_wpi_first_util_WPIUtilJNI
* Method: createEvent
* Method: makeEvent
* Signature: (ZZ)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_util_WPIUtilJNI_createEvent
Java_edu_wpi_first_util_WPIUtilJNI_makeEvent
(JNIEnv*, jclass, jboolean manualReset, jboolean initialState)
{
return wpi::MakeEvent(manualReset, initialState);
Expand Down Expand Up @@ -241,11 +241,11 @@ Java_edu_wpi_first_util_WPIUtilJNI_resetEvent

/*
* Class: edu_wpi_first_util_WPIUtilJNI
* Method: createSemaphore
* Method: makeSemaphore
* Signature: (II)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_util_WPIUtilJNI_createSemaphore
Java_edu_wpi_first_util_WPIUtilJNI_makeSemaphore
(JNIEnv*, jclass, jint initialCount, jint maximumCount)
{
return wpi::MakeSemaphore(initialCount, maximumCount);
Expand Down

0 comments on commit 7066ea9

Please sign in to comment.