mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Major formatting changes (breaks diffs). No code changes.
The changes made in this commit do not affect any actual code,
they are purely aesthetic. I ran clang-format with google style
over all .h/.cpp files in wpilibc that weren't in wpilibC++Sim
or gtest, and the eclipse formatter over all of the Java files
using the Google eclipse formatting configuration.
Change-Id: I9627bca0bc103c398ecc1c5ba17467193291ae63
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2011. All Rights Reserved. */
|
||||
/* Copyright (c) FIRST 2011. All Rights Reserved.
|
||||
*/
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
@@ -16,10 +17,10 @@
|
||||
* @return The controller input voltage value in Volts
|
||||
*/
|
||||
double ControllerPower::GetInputVoltage() {
|
||||
int32_t status = 0;
|
||||
double retVal = getVinVoltage(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
double retVal = getVinVoltage(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,10 +28,10 @@ double ControllerPower::GetInputVoltage() {
|
||||
* @return The controller input current value in Amps
|
||||
*/
|
||||
double ControllerPower::GetInputCurrent() {
|
||||
int32_t status = 0;
|
||||
double retVal = getVinCurrent(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
double retVal = getVinCurrent(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,10 +39,10 @@ double ControllerPower::GetInputCurrent() {
|
||||
* @return The controller 6V rail voltage value in Volts
|
||||
*/
|
||||
double ControllerPower::GetVoltage6V() {
|
||||
int32_t status = 0;
|
||||
double retVal = getUserVoltage6V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
double retVal = getUserVoltage6V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,33 +50,35 @@ double ControllerPower::GetVoltage6V() {
|
||||
* @return The controller 6V rail output current value in Amps
|
||||
*/
|
||||
double ControllerPower::GetCurrent6V() {
|
||||
int32_t status = 0;
|
||||
double retVal = getUserCurrent6V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
double retVal = getUserCurrent6V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enabled state of the 6V rail. The rail may be disabled due to a controller
|
||||
* Get the enabled state of the 6V rail. The rail may be disabled due to a
|
||||
* controller
|
||||
* brownout, a short circuit on the rail, or controller over-voltage
|
||||
* @return The controller 6V rail enabled value. True for enabled.
|
||||
*/
|
||||
bool ControllerPower::GetEnabled6V() {
|
||||
int32_t status = 0;
|
||||
bool retVal = getUserActive6V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
bool retVal = getUserActive6V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the count of the total current faults on the 6V rail since the controller has booted
|
||||
* Get the count of the total current faults on the 6V rail since the controller
|
||||
* has booted
|
||||
* @return The number of faults.
|
||||
*/
|
||||
int ControllerPower::GetFaultCount6V() {
|
||||
int32_t status = 0;
|
||||
int retVal = getUserCurrentFaults6V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
int retVal = getUserCurrentFaults6V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,10 +86,10 @@ int ControllerPower::GetFaultCount6V() {
|
||||
* @return The controller 5V rail voltage value in Volts
|
||||
*/
|
||||
double ControllerPower::GetVoltage5V() {
|
||||
int32_t status = 0;
|
||||
double retVal = getUserVoltage5V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
double retVal = getUserVoltage5V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,33 +97,35 @@ double ControllerPower::GetVoltage5V() {
|
||||
* @return The controller 5V rail output current value in Amps
|
||||
*/
|
||||
double ControllerPower::GetCurrent5V() {
|
||||
int32_t status = 0;
|
||||
double retVal = getUserCurrent5V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
double retVal = getUserCurrent5V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enabled state of the 5V rail. The rail may be disabled due to a controller
|
||||
* Get the enabled state of the 5V rail. The rail may be disabled due to a
|
||||
* controller
|
||||
* brownout, a short circuit on the rail, or controller over-voltage
|
||||
* @return The controller 5V rail enabled value. True for enabled.
|
||||
*/
|
||||
bool ControllerPower::GetEnabled5V() {
|
||||
int32_t status = 0;
|
||||
bool retVal = getUserActive5V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
bool retVal = getUserActive5V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the count of the total current faults on the 5V rail since the controller has booted
|
||||
* Get the count of the total current faults on the 5V rail since the controller
|
||||
* has booted
|
||||
* @return The number of faults
|
||||
*/
|
||||
int ControllerPower::GetFaultCount5V() {
|
||||
int32_t status = 0;
|
||||
int retVal = getUserCurrentFaults5V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
int retVal = getUserCurrentFaults5V(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,10 +133,10 @@ int ControllerPower::GetFaultCount5V() {
|
||||
* @return The controller 3.3V rail voltage value in Volts
|
||||
*/
|
||||
double ControllerPower::GetVoltage3V3() {
|
||||
int32_t status = 0;
|
||||
double retVal = getUserVoltage3V3(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
double retVal = getUserVoltage3V3(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,32 +144,33 @@ double ControllerPower::GetVoltage3V3() {
|
||||
* @return The controller 3.3V rail output current value in Amps
|
||||
*/
|
||||
double ControllerPower::GetCurrent3V3() {
|
||||
int32_t status = 0;
|
||||
double retVal = getUserCurrent3V3(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
double retVal = getUserCurrent3V3(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the enabled state of the 3.3V rail. The rail may be disabled due to a controller
|
||||
* Get the enabled state of the 3.3V rail. The rail may be disabled due to a
|
||||
* controller
|
||||
* brownout, a short circuit on the rail, or controller over-voltage
|
||||
* @return The controller 3.3V rail enabled value. True for enabled.
|
||||
*/
|
||||
bool ControllerPower::GetEnabled3V3() {
|
||||
int32_t status = 0;
|
||||
bool retVal = getUserActive3V3(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
bool retVal = getUserActive3V3(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the count of the total current faults on the 3.3V rail since the controller has booted
|
||||
* Get the count of the total current faults on the 3.3V rail since the
|
||||
* controller has booted
|
||||
* @return The number of faults
|
||||
*/
|
||||
int ControllerPower::GetFaultCount3V3() {
|
||||
int32_t status = 0;
|
||||
int retVal = getUserCurrentFaults3V3(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
int32_t status = 0;
|
||||
int retVal = getUserCurrentFaults3V3(&status);
|
||||
wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
|
||||
return retVal;
|
||||
}
|
||||
Reference in New Issue
Block a user