[hal, wpilib] Remove power rails that don't exist on systemcore (#7861)

This commit is contained in:
Thad House
2025-03-14 10:16:08 -07:00
committed by GitHub
parent d3cc185382
commit 52b353fe57
44 changed files with 27 additions and 3196 deletions

View File

@@ -469,21 +469,6 @@ Java_edu_wpi_first_hal_HALUtil_getHALRuntimeType
return returnValue;
}
/*
* Class: edu_wpi_first_hal_HALUtil
* Method: getFPGAButton
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL
Java_edu_wpi_first_hal_HALUtil_getFPGAButton
(JNIEnv* env, jclass)
{
int32_t status = 0;
jboolean returnValue = HAL_GetFPGAButton(&status);
CheckStatus(env, status);
return returnValue;
}
/*
* Class: edu_wpi_first_hal_HALUtil
* Method: getHALErrorMessage

View File

@@ -1,49 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "HALUtil.h"
#include "edu_wpi_first_hal_LEDJNI.h"
#include "hal/LEDs.h"
static_assert(edu_wpi_first_hal_LEDJNI_RADIO_LED_STATE_OFF ==
HAL_RadioLEDState::HAL_RadioLED_kOff);
static_assert(edu_wpi_first_hal_LEDJNI_RADIO_LED_STATE_GREEN ==
HAL_RadioLEDState::HAL_RadioLED_kGreen);
static_assert(edu_wpi_first_hal_LEDJNI_RADIO_LED_STATE_RED ==
HAL_RadioLEDState::HAL_RadioLED_kRed);
static_assert(edu_wpi_first_hal_LEDJNI_RADIO_LED_STATE_ORANGE ==
HAL_RadioLEDState::HAL_RadioLED_kOrange);
using namespace hal;
extern "C" {
/*
* Class: edu_wpi_first_hal_LEDJNI
* Method: setRadioLEDState
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_LEDJNI_setRadioLEDState
(JNIEnv* env, jclass, jint state)
{
int32_t status = 0;
HAL_SetRadioLEDState(static_cast<HAL_RadioLEDState>(state), &status);
CheckStatus(env, status);
}
/*
* Class: edu_wpi_first_hal_LEDJNI
* Method: getRadioLEDState
* Signature: ()I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_LEDJNI_getRadioLEDState
(JNIEnv* env, jclass)
{
int32_t status = 0;
auto retVal = HAL_GetRadioLEDState(&status);
CheckStatus(env, status);
return retVal;
}
} // extern "C"

View File

@@ -27,169 +27,6 @@ Java_edu_wpi_first_hal_PowerJNI_getVinVoltage
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getVinCurrent
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_PowerJNI_getVinCurrent
(JNIEnv* env, jclass)
{
int32_t status = 0;
double val = HAL_GetVinCurrent(&status);
CheckStatus(env, status);
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getUserVoltage6V
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_PowerJNI_getUserVoltage6V
(JNIEnv* env, jclass)
{
int32_t status = 0;
double val = HAL_GetUserVoltage6V(&status);
CheckStatus(env, status);
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getUserCurrent6V
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_PowerJNI_getUserCurrent6V
(JNIEnv* env, jclass)
{
int32_t status = 0;
double val = HAL_GetUserCurrent6V(&status);
CheckStatus(env, status);
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: setUserEnabled6V
* Signature: (Z)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_PowerJNI_setUserEnabled6V
(JNIEnv* env, jclass, jboolean enabled)
{
int32_t status = 0;
HAL_SetUserRailEnabled6V(enabled, &status);
CheckStatus(env, status);
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getUserActive6V
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL
Java_edu_wpi_first_hal_PowerJNI_getUserActive6V
(JNIEnv* env, jclass)
{
int32_t status = 0;
bool val = HAL_GetUserActive6V(&status);
CheckStatus(env, status);
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getUserCurrentFaults6V
* Signature: ()I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_PowerJNI_getUserCurrentFaults6V
(JNIEnv* env, jclass)
{
int32_t status = 0;
int32_t val = HAL_GetUserCurrentFaults6V(&status);
CheckStatus(env, status);
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getUserVoltage5V
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_PowerJNI_getUserVoltage5V
(JNIEnv* env, jclass)
{
int32_t status = 0;
double val = HAL_GetUserVoltage5V(&status);
CheckStatus(env, status);
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getUserCurrent5V
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_PowerJNI_getUserCurrent5V
(JNIEnv* env, jclass)
{
int32_t status = 0;
double val = HAL_GetUserCurrent5V(&status);
CheckStatus(env, status);
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: setUserEnabled5V
* Signature: (Z)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_PowerJNI_setUserEnabled5V
(JNIEnv* env, jclass, jboolean enabled)
{
int32_t status = 0;
HAL_SetUserRailEnabled5V(enabled, &status);
CheckStatus(env, status);
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getUserActive5V
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL
Java_edu_wpi_first_hal_PowerJNI_getUserActive5V
(JNIEnv* env, jclass)
{
int32_t status = 0;
bool val = HAL_GetUserActive5V(&status);
CheckStatus(env, status);
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getUserCurrentFaults5V
* Signature: ()I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_PowerJNI_getUserCurrentFaults5V
(JNIEnv* env, jclass)
{
int32_t status = 0;
int32_t val = HAL_GetUserCurrentFaults5V(&status);
CheckStatus(env, status);
return val;
}
/*
* Class: edu_wpi_first_hal_PowerJNI
* Method: getUserVoltage3V3

View File

@@ -15,56 +15,6 @@ using namespace wpi::java;
extern "C" {
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerFPGAButtonCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerFPGAButtonCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify, &HALSIM_RegisterRoboRioFPGAButtonCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelFPGAButtonCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelFPGAButtonCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioFPGAButtonCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getFPGAButton
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getFPGAButton
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioFPGAButton();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setFPGAButton
* Signature: (Z)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setFPGAButton
(JNIEnv*, jclass, jboolean value)
{
HALSIM_SetRoboRioFPGAButton(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerVInVoltageCallback
@@ -115,362 +65,6 @@ Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setVInVoltage
HALSIM_SetRoboRioVInVoltage(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerVInCurrentCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerVInCurrentCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify, &HALSIM_RegisterRoboRioVInCurrentCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelVInCurrentCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelVInCurrentCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioVInCurrentCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getVInCurrent
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getVInCurrent
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioVInCurrent();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setVInCurrent
* Signature: (D)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setVInCurrent
(JNIEnv*, jclass, jdouble value)
{
HALSIM_SetRoboRioVInCurrent(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserVoltage6VCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserVoltage6VCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify,
&HALSIM_RegisterRoboRioUserVoltage6VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelUserVoltage6VCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserVoltage6VCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioUserVoltage6VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getUserVoltage6V
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserVoltage6V
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioUserVoltage6V();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setUserVoltage6V
* Signature: (D)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserVoltage6V
(JNIEnv*, jclass, jdouble value)
{
HALSIM_SetRoboRioUserVoltage6V(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserCurrent6VCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserCurrent6VCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify,
&HALSIM_RegisterRoboRioUserCurrent6VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelUserCurrent6VCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserCurrent6VCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioUserCurrent6VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getUserCurrent6V
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserCurrent6V
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioUserCurrent6V();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setUserCurrent6V
* Signature: (D)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserCurrent6V
(JNIEnv*, jclass, jdouble value)
{
HALSIM_SetRoboRioUserCurrent6V(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserActive6VCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserActive6VCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify,
&HALSIM_RegisterRoboRioUserActive6VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelUserActive6VCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserActive6VCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioUserActive6VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getUserActive6V
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserActive6V
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioUserActive6V();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setUserActive6V
* Signature: (Z)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserActive6V
(JNIEnv*, jclass, jboolean value)
{
HALSIM_SetRoboRioUserActive6V(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserVoltage5VCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserVoltage5VCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify,
&HALSIM_RegisterRoboRioUserVoltage5VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelUserVoltage5VCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserVoltage5VCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioUserVoltage5VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getUserVoltage5V
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserVoltage5V
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioUserVoltage5V();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setUserVoltage5V
* Signature: (D)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserVoltage5V
(JNIEnv*, jclass, jdouble value)
{
HALSIM_SetRoboRioUserVoltage5V(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserCurrent5VCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserCurrent5VCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify,
&HALSIM_RegisterRoboRioUserCurrent5VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelUserCurrent5VCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserCurrent5VCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioUserCurrent5VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getUserCurrent5V
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserCurrent5V
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioUserCurrent5V();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setUserCurrent5V
* Signature: (D)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserCurrent5V
(JNIEnv*, jclass, jdouble value)
{
HALSIM_SetRoboRioUserCurrent5V(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserActive5VCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserActive5VCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify,
&HALSIM_RegisterRoboRioUserActive5VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelUserActive5VCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserActive5VCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioUserActive5VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getUserActive5V
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserActive5V
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioUserActive5V();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setUserActive5V
* Signature: (Z)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserActive5V
(JNIEnv*, jclass, jboolean value)
{
HALSIM_SetRoboRioUserActive5V(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserVoltage3V3Callback
@@ -624,108 +218,6 @@ Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserActive3V3
HALSIM_SetRoboRioUserActive3V3(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserFaults6VCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserFaults6VCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify,
&HALSIM_RegisterRoboRioUserFaults6VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelUserFaults6VCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserFaults6VCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioUserFaults6VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getUserFaults6V
* Signature: ()I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserFaults6V
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioUserFaults6V();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setUserFaults6V
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserFaults6V
(JNIEnv*, jclass, jint value)
{
HALSIM_SetRoboRioUserFaults6V(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserFaults5VCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserFaults5VCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify,
&HALSIM_RegisterRoboRioUserFaults5VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelUserFaults5VCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserFaults5VCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioUserFaults5VCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getUserFaults5V
* Signature: ()I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserFaults5V
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioUserFaults5V();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setUserFaults5V
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserFaults5V
(JNIEnv*, jclass, jint value)
{
HALSIM_SetRoboRioUserFaults5V(value);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerUserFaults3V3Callback
@@ -988,57 +480,6 @@ Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setComments
HALSIM_SetRoboRioComments(&str);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: registerRadioLEDStateCallback
* Signature: (Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerRadioLEDStateCallback
(JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallbackNoIndex(
env, callback, initialNotify,
&HALSIM_RegisterRoboRioRadioLEDStateCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: cancelRadioLEDStateCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelRadioLEDStateCallback
(JNIEnv* env, jclass, jint handle)
{
return sim::FreeCallbackNoIndex(env, handle,
&HALSIM_CancelRoboRioRadioLEDStateCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: getRadioLEDState
* Signature: ()I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getRadioLEDState
(JNIEnv*, jclass)
{
return HALSIM_GetRoboRioRadioLEDState();
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: setRadioLEDState
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setRadioLEDState
(JNIEnv*, jclass, jint value)
{
HALSIM_SetRoboRioRadioLEDState(static_cast<HAL_RadioLEDState>(value));
}
/*
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
* Method: resetData

View File

@@ -18,7 +18,6 @@
#include "hal/Errors.h"
#include "hal/HALBase.h"
#include "hal/I2C.h"
#include "hal/LEDs.h"
#include "hal/Main.h"
#include "hal/Notifier.h"
#include "hal/PWM.h"

View File

@@ -113,18 +113,6 @@ int32_t HAL_GetTeamNumber(void);
*/
HAL_RuntimeType HAL_GetRuntimeType(void);
/**
* Gets the state of the "USER" button on the roboRIO.
*
* @warning the User Button is used to stop user programs from automatically
* loading if it is held for more then 5 seconds. Because of this, it's not
* recommended to be used by teams for any other purpose.
*
* @param[out] status the error code, or 0 for success
* @return true if the button is currently pressed down
*/
HAL_Bool HAL_GetFPGAButton(int32_t* status);
/**
* Gets if the system outputs are currently active.
*

View File

@@ -1,34 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include "hal/Types.h"
HAL_ENUM(HAL_RadioLEDState) {
HAL_RadioLED_kOff = 0,
HAL_RadioLED_kGreen = 1,
HAL_RadioLED_kRed = 2,
HAL_RadioLED_kOrange = 3
};
#ifdef __cplusplus
extern "C" {
#endif
/**
* Set the state of the "Radio" LED.
* @param state The state to set the LED to.
* @param[out] status the error code, or 0 for success
*/
void HAL_SetRadioLEDState(HAL_RadioLEDState state, int32_t* status);
/**
* Get the state of the "Radio" LED.
*
* @param[out] status the error code, or 0 for success
* @return The state of the LED.
*/
HAL_RadioLEDState HAL_GetRadioLEDState(int32_t* status);
#ifdef __cplusplus
} // extern "C"
#endif

View File

@@ -26,94 +26,6 @@ extern "C" {
*/
double HAL_GetVinVoltage(int32_t* status);
/**
* Gets the roboRIO input current.
*
* @param[out] status the error code, or 0 for success
* @return the input current (amps)
*/
double HAL_GetVinCurrent(int32_t* status);
/**
* Gets the 6V rail voltage.
*
* @param[out] status the error code, or 0 for success
* @return the 6V rail voltage (volts)
*/
double HAL_GetUserVoltage6V(int32_t* status);
/**
* Gets the 6V rail current.
*
* @param[out] status the error code, or 0 for success
* @return the 6V rail current (amps)
*/
double HAL_GetUserCurrent6V(int32_t* status);
/**
* Gets the active state of the 6V rail.
*
* @param[out] status the error code, or 0 for success
* @return true if the rail is active, otherwise false
*/
HAL_Bool HAL_GetUserActive6V(int32_t* status);
/**
* Gets the fault count for the 6V rail. Capped at 255.
*
* @param[out] status the error code, or 0 for success
* @return the number of 6V fault counts
*/
int32_t HAL_GetUserCurrentFaults6V(int32_t* status);
/**
* Enables or disables the 6V rail.
*
* @param enabled whether the rail should be enabled
* @param[out] status the error code, or 0 for success
*/
void HAL_SetUserRailEnabled6V(HAL_Bool enabled, int32_t* status);
/**
* Gets the 5V rail voltage.
*
* @param[out] status the error code, or 0 for success
* @return the 5V rail voltage (volts)
*/
double HAL_GetUserVoltage5V(int32_t* status);
/**
* Gets the 5V rail current.
*
* @param[out] status the error code, or 0 for success
* @return the 5V rail current (amps)
*/
double HAL_GetUserCurrent5V(int32_t* status);
/**
* Gets the active state of the 5V rail.
*
* @param[out] status the error code, or 0 for success
* @return true if the rail is active, otherwise false
*/
HAL_Bool HAL_GetUserActive5V(int32_t* status);
/**
* Gets the fault count for the 5V rail. Capped at 255.
*
* @param[out] status the error code, or 0 for success
* @return the number of 5V fault counts
*/
int32_t HAL_GetUserCurrentFaults5V(int32_t* status);
/**
* Enables or disables the 5V rail.
*
* @param enabled whether the rail should be enabled
* @param[out] status the error code, or 0 for success
*/
void HAL_SetUserRailEnabled5V(HAL_Bool enabled, int32_t* status);
/**
* Gets the 3V3 rail voltage.
*

View File

@@ -8,7 +8,6 @@
#include <wpi/string.h>
#include "hal/LEDs.h"
#include "hal/Types.h"
#include "hal/simulation/NotifyListener.h"
@@ -34,55 +33,6 @@ void HALSIM_CancelRoboRioVInVoltageCallback(int32_t uid);
double HALSIM_GetRoboRioVInVoltage(void);
void HALSIM_SetRoboRioVInVoltage(double vInVoltage);
int32_t HALSIM_RegisterRoboRioVInCurrentCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioVInCurrentCallback(int32_t uid);
double HALSIM_GetRoboRioVInCurrent(void);
void HALSIM_SetRoboRioVInCurrent(double vInCurrent);
int32_t HALSIM_RegisterRoboRioUserVoltage6VCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserVoltage6VCallback(int32_t uid);
double HALSIM_GetRoboRioUserVoltage6V(void);
void HALSIM_SetRoboRioUserVoltage6V(double userVoltage6V);
int32_t HALSIM_RegisterRoboRioUserCurrent6VCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserCurrent6VCallback(int32_t uid);
double HALSIM_GetRoboRioUserCurrent6V(void);
void HALSIM_SetRoboRioUserCurrent6V(double userCurrent6V);
int32_t HALSIM_RegisterRoboRioUserActive6VCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserActive6VCallback(int32_t uid);
HAL_Bool HALSIM_GetRoboRioUserActive6V(void);
void HALSIM_SetRoboRioUserActive6V(HAL_Bool userActive6V);
int32_t HALSIM_RegisterRoboRioUserVoltage5VCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserVoltage5VCallback(int32_t uid);
double HALSIM_GetRoboRioUserVoltage5V(void);
void HALSIM_SetRoboRioUserVoltage5V(double userVoltage5V);
int32_t HALSIM_RegisterRoboRioUserCurrent5VCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserCurrent5VCallback(int32_t uid);
double HALSIM_GetRoboRioUserCurrent5V(void);
void HALSIM_SetRoboRioUserCurrent5V(double userCurrent5V);
int32_t HALSIM_RegisterRoboRioUserActive5VCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserActive5VCallback(int32_t uid);
HAL_Bool HALSIM_GetRoboRioUserActive5V(void);
void HALSIM_SetRoboRioUserActive5V(HAL_Bool userActive5V);
int32_t HALSIM_RegisterRoboRioUserVoltage3V3Callback(
HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserVoltage3V3Callback(int32_t uid);
@@ -102,20 +52,6 @@ void HALSIM_CancelRoboRioUserActive3V3Callback(int32_t uid);
HAL_Bool HALSIM_GetRoboRioUserActive3V3(void);
void HALSIM_SetRoboRioUserActive3V3(HAL_Bool userActive3V3);
int32_t HALSIM_RegisterRoboRioUserFaults6VCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserFaults6VCallback(int32_t uid);
int32_t HALSIM_GetRoboRioUserFaults6V(void);
void HALSIM_SetRoboRioUserFaults6V(int32_t userFaults6V);
int32_t HALSIM_RegisterRoboRioUserFaults5VCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserFaults5VCallback(int32_t uid);
int32_t HALSIM_GetRoboRioUserFaults5V(void);
void HALSIM_SetRoboRioUserFaults5V(int32_t userFaults5V);
int32_t HALSIM_RegisterRoboRioUserFaults3V3Callback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
@@ -155,13 +91,6 @@ void HALSIM_CancelRoboRioCPUTempCallback(int32_t uid);
double HALSIM_GetRoboRioCPUTemp(void);
void HALSIM_SetRoboRioCPUTemp(double cpuTemp);
int32_t HALSIM_RegisterRoboRioRadioLEDStateCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioRadioLEDStateCallback(int32_t uid);
HAL_RadioLEDState HALSIM_GetRoboRioRadioLEDState(void);
void HALSIM_SetRoboRioRadioLEDState(HAL_RadioLEDState state);
void HALSIM_RegisterRoboRioAllCallbacks(HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
#ifdef __cplusplus

View File

@@ -289,10 +289,6 @@ uint64_t HAL_ExpandFPGATime(uint32_t unexpandedLower, int32_t* status) {
return (upper << 32) + static_cast<uint64_t>(unexpandedLower);
}
HAL_Bool HAL_GetFPGAButton(int32_t* status) {
return SimRoboRioData[0].fpgaButton;
}
HAL_Bool HAL_GetSystemActive(int32_t* status) {
return HALSIM_GetDriverStationEnabled();
}

View File

@@ -1,21 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "hal/LEDs.h"
#include "hal/simulation/RoboRioData.h"
namespace hal::init {
void InitializeLEDs() {}
} // namespace hal::init
extern "C" {
void HAL_SetRadioLEDState(HAL_RadioLEDState state, int32_t* status) {
HALSIM_SetRoboRioRadioLEDState(state);
}
HAL_RadioLEDState HAL_GetRadioLEDState(int32_t* status) {
return HALSIM_GetRoboRioRadioLEDState();
}
} // extern "C"

View File

@@ -17,34 +17,6 @@ extern "C" {
double HAL_GetVinVoltage(int32_t* status) {
return SimRoboRioData->vInVoltage;
}
double HAL_GetVinCurrent(int32_t* status) {
return SimRoboRioData->vInCurrent;
}
double HAL_GetUserVoltage6V(int32_t* status) {
return SimRoboRioData->userVoltage6V;
}
double HAL_GetUserCurrent6V(int32_t* status) {
return SimRoboRioData->userCurrent6V;
}
HAL_Bool HAL_GetUserActive6V(int32_t* status) {
return SimRoboRioData->userActive6V;
}
int32_t HAL_GetUserCurrentFaults6V(int32_t* status) {
return SimRoboRioData->userFaults6V;
}
void HAL_SetUserRailEnabled6V(HAL_Bool enabled, int32_t* status) {}
double HAL_GetUserVoltage5V(int32_t* status) {
return SimRoboRioData->userVoltage5V;
}
double HAL_GetUserCurrent5V(int32_t* status) {
return SimRoboRioData->userCurrent5V;
}
HAL_Bool HAL_GetUserActive5V(int32_t* status) {
return SimRoboRioData->userActive5V;
}
int32_t HAL_GetUserCurrentFaults5V(int32_t* status) {
return SimRoboRioData->userFaults5V;
}
void HAL_SetUserRailEnabled5V(HAL_Bool enabled, int32_t* status) {}
double HAL_GetUserVoltage3V3(int32_t* status) {
return SimRoboRioData->userVoltage3V3;
@@ -61,8 +33,6 @@ int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) {
void HAL_SetUserRailEnabled3V3(HAL_Bool enabled, int32_t* status) {}
void HAL_ResetUserCurrentFaults(int32_t* status) {
SimRoboRioData->userFaults3V3 = 0;
SimRoboRioData->userFaults5V = 0;
SimRoboRioData->userFaults6V = 0;
}
void HAL_SetBrownoutVoltage(double voltage, int32_t* status) {
SimRoboRioData->brownoutVoltage = voltage;

View File

@@ -17,20 +17,10 @@ void InitializeRoboRioData() {
RoboRioData* hal::SimRoboRioData;
void RoboRioData::ResetData() {
fpgaButton.Reset(false);
vInVoltage.Reset(12.0);
vInCurrent.Reset(0.0);
userVoltage6V.Reset(6.0);
userCurrent6V.Reset(0.0);
userActive6V.Reset(true);
userVoltage5V.Reset(5.0);
userCurrent5V.Reset(0.0);
userActive5V.Reset(true);
userVoltage3V3.Reset(3.3);
userCurrent3V3.Reset(0.0);
userActive3V3.Reset(true);
userFaults6V.Reset(0);
userFaults5V.Reset(0);
userFaults3V3.Reset(0);
brownoutVoltage.Reset(6.75);
cpuTemp.Reset(45.0);
@@ -110,25 +100,14 @@ void HALSIM_ResetRoboRioData(void) {
HAL_SIMDATAVALUE_DEFINE_CAPI_NOINDEX(TYPE, HALSIM, RoboRio##CAPINAME, \
SimRoboRioData, LOWERNAME)
DEFINE_CAPI(HAL_Bool, FPGAButton, fpgaButton)
DEFINE_CAPI(double, VInVoltage, vInVoltage)
DEFINE_CAPI(double, VInCurrent, vInCurrent)
DEFINE_CAPI(double, UserVoltage6V, userVoltage6V)
DEFINE_CAPI(double, UserCurrent6V, userCurrent6V)
DEFINE_CAPI(HAL_Bool, UserActive6V, userActive6V)
DEFINE_CAPI(double, UserVoltage5V, userVoltage5V)
DEFINE_CAPI(double, UserCurrent5V, userCurrent5V)
DEFINE_CAPI(HAL_Bool, UserActive5V, userActive5V)
DEFINE_CAPI(double, UserVoltage3V3, userVoltage3V3)
DEFINE_CAPI(double, UserCurrent3V3, userCurrent3V3)
DEFINE_CAPI(HAL_Bool, UserActive3V3, userActive3V3)
DEFINE_CAPI(int32_t, UserFaults6V, userFaults6V)
DEFINE_CAPI(int32_t, UserFaults5V, userFaults5V)
DEFINE_CAPI(int32_t, UserFaults3V3, userFaults3V3)
DEFINE_CAPI(double, BrownoutVoltage, brownoutVoltage)
DEFINE_CAPI(double, CPUTemp, cpuTemp)
DEFINE_CAPI(int32_t, TeamNumber, teamNumber)
DEFINE_CAPI(HAL_RadioLEDState, RadioLEDState, radioLedState)
int32_t HALSIM_RegisterRoboRioSerialNumberCallback(
HAL_RoboRioStringCallback callback, void* param, HAL_Bool initialNotify) {
@@ -168,23 +147,12 @@ void HALSIM_RegisterRoboRioAllCallbacks(HAL_NotifyCallback callback,
void HALSIM_RegisterRoboRioAllCallbacks(HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify) {
REGISTER(fpgaButton);
REGISTER(vInVoltage);
REGISTER(vInCurrent);
REGISTER(userVoltage6V);
REGISTER(userCurrent6V);
REGISTER(userActive6V);
REGISTER(userVoltage5V);
REGISTER(userCurrent5V);
REGISTER(userActive5V);
REGISTER(userVoltage3V3);
REGISTER(userCurrent3V3);
REGISTER(userActive3V3);
REGISTER(userFaults6V);
REGISTER(userFaults5V);
REGISTER(userFaults3V3);
REGISTER(brownoutVoltage);
REGISTER(cpuTemp);
REGISTER(radioLedState);
}
} // extern "C"

View File

@@ -14,60 +14,31 @@
namespace hal {
class RoboRioData {
HAL_SIMDATAVALUE_DEFINE_NAME(FPGAButton)
HAL_SIMDATAVALUE_DEFINE_NAME(VInVoltage)
HAL_SIMDATAVALUE_DEFINE_NAME(VInCurrent)
HAL_SIMDATAVALUE_DEFINE_NAME(UserVoltage6V)
HAL_SIMDATAVALUE_DEFINE_NAME(UserCurrent6V)
HAL_SIMDATAVALUE_DEFINE_NAME(UserActive6V)
HAL_SIMDATAVALUE_DEFINE_NAME(UserVoltage5V)
HAL_SIMDATAVALUE_DEFINE_NAME(UserCurrent5V)
HAL_SIMDATAVALUE_DEFINE_NAME(UserActive5V)
HAL_SIMDATAVALUE_DEFINE_NAME(UserVoltage3V3)
HAL_SIMDATAVALUE_DEFINE_NAME(UserCurrent3V3)
HAL_SIMDATAVALUE_DEFINE_NAME(UserActive3V3)
HAL_SIMDATAVALUE_DEFINE_NAME(UserFaults6V)
HAL_SIMDATAVALUE_DEFINE_NAME(UserFaults5V)
HAL_SIMDATAVALUE_DEFINE_NAME(UserFaults3V3)
HAL_SIMDATAVALUE_DEFINE_NAME(BrownoutVoltage)
HAL_SIMDATAVALUE_DEFINE_NAME(CPUTemp)
HAL_SIMDATAVALUE_DEFINE_NAME(TeamNumber)
HAL_SIMDATAVALUE_DEFINE_NAME(RadioLEDState)
HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(SerialNumber)
HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(Comments);
static inline HAL_Value MakeRadioLEDStateValue(HAL_RadioLEDState value) {
return HAL_MakeEnum(value);
}
public:
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetFPGAButtonName> fpgaButton{false};
SimDataValue<double, HAL_MakeDouble, GetVInVoltageName> vInVoltage{12.0};
SimDataValue<double, HAL_MakeDouble, GetVInCurrentName> vInCurrent{0.0};
SimDataValue<double, HAL_MakeDouble, GetUserVoltage6VName> userVoltage6V{6.0};
SimDataValue<double, HAL_MakeDouble, GetUserCurrent6VName> userCurrent6V{0.0};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetUserActive6VName> userActive6V{
true};
SimDataValue<double, HAL_MakeDouble, GetUserVoltage5VName> userVoltage5V{5.0};
SimDataValue<double, HAL_MakeDouble, GetUserCurrent5VName> userCurrent5V{0.0};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetUserActive5VName> userActive5V{
true};
SimDataValue<double, HAL_MakeDouble, GetUserVoltage3V3Name> userVoltage3V3{
3.3};
SimDataValue<double, HAL_MakeDouble, GetUserCurrent3V3Name> userCurrent3V3{
0.0};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetUserActive3V3Name> userActive3V3{
true};
SimDataValue<int32_t, HAL_MakeInt, GetUserFaults6VName> userFaults6V{0};
SimDataValue<int32_t, HAL_MakeInt, GetUserFaults5VName> userFaults5V{0};
SimDataValue<int32_t, HAL_MakeInt, GetUserFaults3V3Name> userFaults3V3{0};
SimDataValue<double, HAL_MakeDouble, GetBrownoutVoltageName> brownoutVoltage{
6.75};
SimDataValue<double, HAL_MakeDouble, GetCPUTempName> cpuTemp{45.0};
SimDataValue<int32_t, HAL_MakeInt, GetTeamNumberName> teamNumber{0};
SimDataValue<HAL_RadioLEDState, MakeRadioLEDStateValue, GetRadioLEDStateName>
radioLedState{HAL_RadioLED_kOff};
int32_t RegisterSerialNumberCallback(HAL_RoboRioStringCallback callback,
void* param, HAL_Bool initialNotify);

View File

@@ -59,7 +59,6 @@ void InitializeHAL() {
InitializeEncoder();
InitializeFRCDriverStation();
InitializeI2C();
InitializeLEDs();
InitializeMain();
InitializeNotifier();
InitializeCTREPDP();
@@ -252,12 +251,6 @@ uint64_t HAL_ExpandFPGATime(uint32_t unexpandedLower, int32_t* status) {
return (upper << 32) + static_cast<uint64_t>(unexpandedLower);
}
HAL_Bool HAL_GetFPGAButton(int32_t* status) {
hal::init::CheckInit();
*status = HAL_HANDLE_ERROR;
return false;
}
HAL_Bool HAL_GetSystemActive(int32_t* status) {
hal::init::CheckInit();
*status = HAL_HANDLE_ERROR;

View File

@@ -32,7 +32,6 @@ extern void InitializeEncoder();
extern void InitializeFRCDriverStation();
extern void InitializeHAL();
extern void InitializeI2C();
extern void InitializeLEDs();
extern void InitializeMain();
extern void InitializeNotifier();
extern void InitializeCTREPDP();

View File

@@ -1,34 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "hal/LEDs.h"
#include <unistd.h>
#include <cstring>
#include <fstream>
#include <fmt/format.h>
#include <fmt/std.h>
#include <wpi/fs.h>
#include "HALInternal.h"
#include "hal/Errors.h"
namespace hal::init {
void InitializeLEDs() {}
} // namespace hal::init
extern "C" {
void HAL_SetRadioLEDState(HAL_RadioLEDState state, int32_t* status) {
*status = HAL_HANDLE_ERROR;
return;
}
HAL_RadioLEDState HAL_GetRadioLEDState(int32_t* status) {
*status = HAL_HANDLE_ERROR;
return HAL_RadioLED_kOff;
}
} // extern "C"

View File

@@ -31,72 +31,6 @@ double HAL_GetVinVoltage(int32_t* status) {
return 0;
}
double HAL_GetVinCurrent(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return 0;
}
double HAL_GetUserVoltage6V(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return 0;
}
double HAL_GetUserCurrent6V(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return 0;
}
HAL_Bool HAL_GetUserActive6V(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return 0;
}
int32_t HAL_GetUserCurrentFaults6V(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return 0;
}
void HAL_SetUserRailEnabled6V(HAL_Bool enabled, int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return;
}
double HAL_GetUserVoltage5V(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return 0;
}
double HAL_GetUserCurrent5V(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return 0;
}
HAL_Bool HAL_GetUserActive5V(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return 0;
}
int32_t HAL_GetUserCurrentFaults5V(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return 0;
}
void HAL_SetUserRailEnabled5V(HAL_Bool enabled, int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;
return;
}
double HAL_GetUserVoltage3V3(int32_t* status) {
initializePower(status);
*status = HAL_HANDLE_ERROR;

View File

@@ -12,25 +12,14 @@ void HALSIM_ResetRoboRioData(void) {}
#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
HAL_SIMDATAVALUE_STUB_CAPI_NOINDEX(TYPE, HALSIM, RoboRio##CAPINAME, RETURN)
DEFINE_CAPI(HAL_Bool, FPGAButton, false)
DEFINE_CAPI(double, VInVoltage, 0)
DEFINE_CAPI(double, VInCurrent, 0)
DEFINE_CAPI(double, UserVoltage6V, 0)
DEFINE_CAPI(double, UserCurrent6V, 0)
DEFINE_CAPI(HAL_Bool, UserActive6V, false)
DEFINE_CAPI(double, UserVoltage5V, 0)
DEFINE_CAPI(double, UserCurrent5V, 0)
DEFINE_CAPI(HAL_Bool, UserActive5V, false)
DEFINE_CAPI(double, UserVoltage3V3, 0)
DEFINE_CAPI(double, UserCurrent3V3, 0)
DEFINE_CAPI(HAL_Bool, UserActive3V3, false)
DEFINE_CAPI(int32_t, UserFaults6V, 0)
DEFINE_CAPI(int32_t, UserFaults5V, 0)
DEFINE_CAPI(int32_t, UserFaults3V3, 0)
DEFINE_CAPI(double, BrownoutVoltage, 6.75)
DEFINE_CAPI(double, CPUTemp, 45.0)
DEFINE_CAPI(int32_t, TeamNumber, 0)
DEFINE_CAPI(HAL_RadioLEDState, RadioLEDState, HAL_RadioLED_kOff);
int32_t HALSIM_RegisterRoboRioSerialNumberCallback(
HAL_RoboRioStringCallback callback, void* param, HAL_Bool initialNotify) {