mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal, wpilib] Add brownout voltage configuration (#3632)
This commit is contained in:
@@ -159,6 +159,19 @@ int RobotController::GetFaultCount6V() {
|
||||
return retVal;
|
||||
}
|
||||
|
||||
units::volt_t RobotController::GetBrownoutVoltage() {
|
||||
int32_t status = 0;
|
||||
double retVal = HAL_GetBrownoutVoltage(&status);
|
||||
FRC_CheckErrorStatus(status, "{}", "GetBrownoutVoltage");
|
||||
return units::volt_t(retVal);
|
||||
}
|
||||
|
||||
void RobotController::SetBrownoutVoltage(units::volt_t brownoutVoltage) {
|
||||
int32_t status = 0;
|
||||
HAL_SetBrownoutVoltage(brownoutVoltage.to<double>(), &status);
|
||||
FRC_CheckErrorStatus(status, "{}", "SetBrownoutVoltage");
|
||||
}
|
||||
|
||||
CANStatus RobotController::GetCANStatus() {
|
||||
int32_t status = 0;
|
||||
float percentBusUtilization = 0;
|
||||
|
||||
Reference in New Issue
Block a user