mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Expose power rail disable and cpu temp functionality (#5477)
This commit is contained in:
@@ -72,6 +72,20 @@ Java_edu_wpi_first_hal_PowerJNI_getUserCurrent6V
|
||||
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
|
||||
@@ -132,6 +146,20 @@ Java_edu_wpi_first_hal_PowerJNI_getUserCurrent5V
|
||||
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
|
||||
@@ -192,6 +220,20 @@ Java_edu_wpi_first_hal_PowerJNI_getUserCurrent3V3
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_PowerJNI
|
||||
* Method: setUserEnabled3V3
|
||||
* Signature: (Z)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_PowerJNI_setUserEnabled3V3
|
||||
(JNIEnv* env, jclass, jboolean enabled)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_SetUserRailEnabled3V3(enabled, &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_PowerJNI
|
||||
* Method: getUserActive3V3
|
||||
@@ -251,4 +293,19 @@ Java_edu_wpi_first_hal_PowerJNI_getBrownoutVoltage
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_PowerJNI
|
||||
* Method: getCPUTemp
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_PowerJNI_getCPUTemp
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetCPUTemp(&status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user