mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal] Remove FPGA functions that won't exist on SC (#8273)
This commit is contained in:
@@ -46,28 +46,6 @@ public final class HALUtil extends JNIWrapper {
|
||||
/** SystemCore. */
|
||||
public static final int RUNTIME_SYSTEMCORE = 3;
|
||||
|
||||
/**
|
||||
* Returns the FPGA Version number.
|
||||
*
|
||||
* <p>For now, expect this to be competition year.
|
||||
*
|
||||
* @return FPGA Version number.
|
||||
* @see "HAL_GetFPGAVersion"
|
||||
*/
|
||||
public static native short getFPGAVersion();
|
||||
|
||||
/**
|
||||
* Returns the FPGA Revision number.
|
||||
*
|
||||
* <p>The format of the revision is 3 numbers. The 12 most significant bits are the Major
|
||||
* Revision. the next 8 bits are the Minor Revision. The 12 least significant bits are the Build
|
||||
* Number.
|
||||
*
|
||||
* @return FPGA Revision number.
|
||||
* @see "HAL_GetFPGARevision"
|
||||
*/
|
||||
public static native int getFPGARevision();
|
||||
|
||||
/**
|
||||
* Returns the roboRIO serial number.
|
||||
*
|
||||
|
||||
@@ -362,36 +362,6 @@ JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) {
|
||||
jvm = nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_HALUtil
|
||||
* Method: getFPGAVersion
|
||||
* Signature: ()S
|
||||
*/
|
||||
JNIEXPORT jshort JNICALL
|
||||
Java_edu_wpi_first_hal_HALUtil_getFPGAVersion
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
jshort returnValue = HAL_GetFPGAVersion(&status);
|
||||
CheckStatus(env, status);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_HALUtil
|
||||
* Method: getFPGARevision
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_HALUtil_getFPGARevision
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetFPGARevision(&status);
|
||||
CheckStatus(env, status);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_HALUtil
|
||||
* Method: getSerialNumber
|
||||
|
||||
@@ -63,29 +63,6 @@ const char* HAL_GetLastError(int32_t* status);
|
||||
*/
|
||||
const char* HAL_GetErrorMessage(int32_t code);
|
||||
|
||||
/**
|
||||
* Returns the FPGA Version number.
|
||||
*
|
||||
* For now, expect this to be competition year.
|
||||
*
|
||||
* @param[out] status the error code, or 0 for success
|
||||
* @return FPGA Version number.
|
||||
*/
|
||||
int32_t HAL_GetFPGAVersion(int32_t* status);
|
||||
|
||||
/**
|
||||
* Returns the FPGA Revision number.
|
||||
*
|
||||
* The format of the revision is 3 numbers.
|
||||
* The 12 most significant bits are the Major Revision.
|
||||
* the next 8 bits are the Minor Revision.
|
||||
* The 12 least significant bits are the Build Number.
|
||||
*
|
||||
* @param[out] status the error code, or 0 for success
|
||||
* @return FPGA Revision number.
|
||||
*/
|
||||
int64_t HAL_GetFPGARevision(int32_t* status);
|
||||
|
||||
/**
|
||||
* Returns the roboRIO serial number.
|
||||
*
|
||||
|
||||
@@ -241,14 +241,6 @@ void HALSIM_SetRuntimeType(HAL_RuntimeType type) {
|
||||
runtimeType = type;
|
||||
}
|
||||
|
||||
int32_t HAL_GetFPGAVersion(int32_t* status) {
|
||||
return 2018; // Automatically script this at some point
|
||||
}
|
||||
|
||||
int64_t HAL_GetFPGARevision(int32_t* status) {
|
||||
return 0; // TODO: Find a better number to return;
|
||||
}
|
||||
|
||||
void HAL_GetSerialNumber(struct WPI_String* serialNumber) {
|
||||
HALSIM_GetRoboRioSerialNumber(serialNumber);
|
||||
}
|
||||
|
||||
@@ -171,18 +171,6 @@ HAL_RuntimeType HAL_GetRuntimeType(void) {
|
||||
return runtimeType;
|
||||
}
|
||||
|
||||
int32_t HAL_GetFPGAVersion(int32_t* status) {
|
||||
hal::init::CheckInit();
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int64_t HAL_GetFPGARevision(int32_t* status) {
|
||||
hal::init::CheckInit();
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void HAL_GetSerialNumber(struct WPI_String* serialNumber) {
|
||||
const char* serialNum = std::getenv("serialnum");
|
||||
if (!serialNum) {
|
||||
|
||||
@@ -19,20 +19,6 @@ std::function<uint64_t()> RobotController::m_timeSource = [] {
|
||||
return RobotController::GetFPGATime();
|
||||
};
|
||||
|
||||
int RobotController::GetFPGAVersion() {
|
||||
int32_t status = 0;
|
||||
int version = HAL_GetFPGAVersion(&status);
|
||||
FRC_CheckErrorStatus(status, "GetFPGAVersion");
|
||||
return version;
|
||||
}
|
||||
|
||||
int64_t RobotController::GetFPGARevision() {
|
||||
int32_t status = 0;
|
||||
int64_t revision = HAL_GetFPGARevision(&status);
|
||||
FRC_CheckErrorStatus(status, "GetFPGARevision");
|
||||
return revision;
|
||||
}
|
||||
|
||||
std::string RobotController::GetSerialNumber() {
|
||||
WPI_String serialNum;
|
||||
HAL_GetSerialNumber(&serialNum);
|
||||
|
||||
@@ -26,26 +26,6 @@ class RobotController {
|
||||
public:
|
||||
RobotController() = delete;
|
||||
|
||||
/**
|
||||
* Return the FPGA Version number.
|
||||
*
|
||||
* For now, expect this to be competition year.
|
||||
*
|
||||
* @return FPGA Version number.
|
||||
*/
|
||||
static int GetFPGAVersion();
|
||||
|
||||
/**
|
||||
* Return the FPGA Revision number.
|
||||
*
|
||||
* The format of the revision is 3 numbers. The 12 most significant bits are
|
||||
* the Major Revision. The next 8 bits are the Minor Revision. The 12 least
|
||||
* significant bits are the Build Number.
|
||||
*
|
||||
* @return FPGA Revision number.
|
||||
*/
|
||||
static int64_t GetFPGARevision();
|
||||
|
||||
/**
|
||||
* Return the serial number of the roboRIO.
|
||||
*
|
||||
|
||||
@@ -28,26 +28,6 @@ public final class RobotController {
|
||||
throw new UnsupportedOperationException("This is a utility class!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the FPGA Version number. For now, expect this to be the current year.
|
||||
*
|
||||
* @return FPGA Version number.
|
||||
*/
|
||||
public static int getFPGAVersion() {
|
||||
return HALUtil.getFPGAVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the FPGA Revision number. The format of the revision is 3 numbers. The 12 most
|
||||
* significant bits are the Major Revision. the next 8 bits are the Minor Revision. The 12 least
|
||||
* significant bits are the Build Number.
|
||||
*
|
||||
* @return FPGA Revision number.
|
||||
*/
|
||||
public static long getFPGARevision() {
|
||||
return HALUtil.getFPGARevision();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the serial number of the roboRIO.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user