Skip to content

Commit b1aaabc

Browse files
authored
[hal] Remove FPGA functions that won't exist on SC (#8273)
1 parent 5c719ce commit b1aaabc

File tree

8 files changed

+0
-149
lines changed

8 files changed

+0
-149
lines changed

hal/src/main/java/edu/wpi/first/hal/HALUtil.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,6 @@ public final class HALUtil extends JNIWrapper {
4646
/** SystemCore. */
4747
public static final int RUNTIME_SYSTEMCORE = 3;
4848

49-
/**
50-
* Returns the FPGA Version number.
51-
*
52-
* <p>For now, expect this to be competition year.
53-
*
54-
* @return FPGA Version number.
55-
* @see "HAL_GetFPGAVersion"
56-
*/
57-
public static native short getFPGAVersion();
58-
59-
/**
60-
* Returns the FPGA Revision number.
61-
*
62-
* <p>The format of the revision is 3 numbers. The 12 most significant bits are the Major
63-
* Revision. the next 8 bits are the Minor Revision. The 12 least significant bits are the Build
64-
* Number.
65-
*
66-
* @return FPGA Revision number.
67-
* @see "HAL_GetFPGARevision"
68-
*/
69-
public static native int getFPGARevision();
70-
7149
/**
7250
* Returns the roboRIO serial number.
7351
*

hal/src/main/native/cpp/jni/HALUtil.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -362,36 +362,6 @@ JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) {
362362
jvm = nullptr;
363363
}
364364

365-
/*
366-
* Class: edu_wpi_first_hal_HALUtil
367-
* Method: getFPGAVersion
368-
* Signature: ()S
369-
*/
370-
JNIEXPORT jshort JNICALL
371-
Java_edu_wpi_first_hal_HALUtil_getFPGAVersion
372-
(JNIEnv* env, jclass)
373-
{
374-
int32_t status = 0;
375-
jshort returnValue = HAL_GetFPGAVersion(&status);
376-
CheckStatus(env, status);
377-
return returnValue;
378-
}
379-
380-
/*
381-
* Class: edu_wpi_first_hal_HALUtil
382-
* Method: getFPGARevision
383-
* Signature: ()I
384-
*/
385-
JNIEXPORT jint JNICALL
386-
Java_edu_wpi_first_hal_HALUtil_getFPGARevision
387-
(JNIEnv* env, jclass)
388-
{
389-
int32_t status = 0;
390-
jint returnValue = HAL_GetFPGARevision(&status);
391-
CheckStatus(env, status);
392-
return returnValue;
393-
}
394-
395365
/*
396366
* Class: edu_wpi_first_hal_HALUtil
397367
* Method: getSerialNumber

hal/src/main/native/include/hal/HALBase.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,6 @@ const char* HAL_GetLastError(int32_t* status);
6363
*/
6464
const char* HAL_GetErrorMessage(int32_t code);
6565

66-
/**
67-
* Returns the FPGA Version number.
68-
*
69-
* For now, expect this to be competition year.
70-
*
71-
* @param[out] status the error code, or 0 for success
72-
* @return FPGA Version number.
73-
*/
74-
int32_t HAL_GetFPGAVersion(int32_t* status);
75-
76-
/**
77-
* Returns the FPGA Revision number.
78-
*
79-
* The format of the revision is 3 numbers.
80-
* The 12 most significant bits are the Major Revision.
81-
* the next 8 bits are the Minor Revision.
82-
* The 12 least significant bits are the Build Number.
83-
*
84-
* @param[out] status the error code, or 0 for success
85-
* @return FPGA Revision number.
86-
*/
87-
int64_t HAL_GetFPGARevision(int32_t* status);
88-
8966
/**
9067
* Returns the roboRIO serial number.
9168
*

hal/src/main/native/sim/HAL.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,6 @@ void HALSIM_SetRuntimeType(HAL_RuntimeType type) {
241241
runtimeType = type;
242242
}
243243

244-
int32_t HAL_GetFPGAVersion(int32_t* status) {
245-
return 2018; // Automatically script this at some point
246-
}
247-
248-
int64_t HAL_GetFPGARevision(int32_t* status) {
249-
return 0; // TODO: Find a better number to return;
250-
}
251-
252244
void HAL_GetSerialNumber(struct WPI_String* serialNumber) {
253245
HALSIM_GetRoboRioSerialNumber(serialNumber);
254246
}

hal/src/main/native/systemcore/HAL.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,6 @@ HAL_RuntimeType HAL_GetRuntimeType(void) {
171171
return runtimeType;
172172
}
173173

174-
int32_t HAL_GetFPGAVersion(int32_t* status) {
175-
hal::init::CheckInit();
176-
*status = HAL_HANDLE_ERROR;
177-
return 0;
178-
}
179-
180-
int64_t HAL_GetFPGARevision(int32_t* status) {
181-
hal::init::CheckInit();
182-
*status = HAL_HANDLE_ERROR;
183-
return 0;
184-
}
185-
186174
void HAL_GetSerialNumber(struct WPI_String* serialNumber) {
187175
const char* serialNum = std::getenv("serialnum");
188176
if (!serialNum) {

wpilibc/src/main/native/cpp/RobotController.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,6 @@ std::function<uint64_t()> RobotController::m_timeSource = [] {
1919
return RobotController::GetFPGATime();
2020
};
2121

22-
int RobotController::GetFPGAVersion() {
23-
int32_t status = 0;
24-
int version = HAL_GetFPGAVersion(&status);
25-
FRC_CheckErrorStatus(status, "GetFPGAVersion");
26-
return version;
27-
}
28-
29-
int64_t RobotController::GetFPGARevision() {
30-
int32_t status = 0;
31-
int64_t revision = HAL_GetFPGARevision(&status);
32-
FRC_CheckErrorStatus(status, "GetFPGARevision");
33-
return revision;
34-
}
35-
3622
std::string RobotController::GetSerialNumber() {
3723
WPI_String serialNum;
3824
HAL_GetSerialNumber(&serialNum);

wpilibc/src/main/native/include/frc/RobotController.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,6 @@ class RobotController {
2626
public:
2727
RobotController() = delete;
2828

29-
/**
30-
* Return the FPGA Version number.
31-
*
32-
* For now, expect this to be competition year.
33-
*
34-
* @return FPGA Version number.
35-
*/
36-
static int GetFPGAVersion();
37-
38-
/**
39-
* Return the FPGA Revision number.
40-
*
41-
* The format of the revision is 3 numbers. The 12 most significant bits are
42-
* the Major Revision. The next 8 bits are the Minor Revision. The 12 least
43-
* significant bits are the Build Number.
44-
*
45-
* @return FPGA Revision number.
46-
*/
47-
static int64_t GetFPGARevision();
48-
4929
/**
5030
* Return the serial number of the roboRIO.
5131
*

wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotController.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,6 @@ private RobotController() {
2828
throw new UnsupportedOperationException("This is a utility class!");
2929
}
3030

31-
/**
32-
* Return the FPGA Version number. For now, expect this to be the current year.
33-
*
34-
* @return FPGA Version number.
35-
*/
36-
public static int getFPGAVersion() {
37-
return HALUtil.getFPGAVersion();
38-
}
39-
40-
/**
41-
* Return the FPGA Revision number. The format of the revision is 3 numbers. The 12 most
42-
* significant bits are the Major Revision. the next 8 bits are the Minor Revision. The 12 least
43-
* significant bits are the Build Number.
44-
*
45-
* @return FPGA Revision number.
46-
*/
47-
public static long getFPGARevision() {
48-
return HALUtil.getFPGARevision();
49-
}
50-
5131
/**
5232
* Return the serial number of the roboRIO.
5333
*

0 commit comments

Comments
 (0)