Ran formatter again (#45)

The previous wpilibc reformat missed an issue with CANTalon.h, and a patch merged since then didn't run the formatter.
This commit is contained in:
Tyler Veness
2016-05-22 21:39:33 -07:00
committed by Peter Johnson
parent e71f454b9d
commit 0d655d7cec
3 changed files with 19 additions and 15 deletions

View File

@@ -22,15 +22,15 @@ int HALGetAllianceStation(enum HALAllianceStationID* allianceStation) {
(AllianceStationID_t*)allianceStation);
}
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes) {
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes* axes) {
HALJoystickAxesInt axesInt;
int retVal = FRC_NetworkCommunication_getJoystickAxes(
joystickNum, (JoystickAxes_t*) &axesInt, kMaxJoystickAxes);
joystickNum, (JoystickAxes_t*)&axesInt, kMaxJoystickAxes);
// copy int values to float values
axes->count = axesInt.count;
// current scaling is -128 to 127, can easily be patched in the future by
// current scaling is -128 to 127, can easily be patched in the future by
// changing this function.
for (unsigned int i = 0; i < axesInt.count; i++) {
int8_t value = axesInt.axes[i];
@@ -40,7 +40,7 @@ int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes) {
axes->axes[i] = value / 127.0f;
}
}
return retVal;
}

View File

@@ -112,6 +112,7 @@ class CANTalon : public MotorSafety,
struct TrajectoryPoint {
double position; //!< The position to servo to.
double velocity; //!< The velocity to feed-forward.
/**
* Time in milliseconds to process this point.
* Value should be between 1ms and 255ms. If value is zero

View File

@@ -33,14 +33,17 @@ const uint32_t DriverStation::kJoystickPorts;
* This is only called once the first time GetInstance() is called
*/
DriverStation::DriverStation() {
m_joystickAxes = std::make_unique<HALJoystickAxes[]> (kJoystickPorts);
m_joystickPOVs = std::make_unique<HALJoystickPOVs[]> (kJoystickPorts);
m_joystickButtons = std::make_unique<HALJoystickButtons[]> (kJoystickPorts);
m_joystickDescriptor = std::make_unique<HALJoystickDescriptor[]> (kJoystickPorts);
m_joystickAxesCache = std::make_unique<HALJoystickAxes[]> (kJoystickPorts);
m_joystickPOVsCache = std::make_unique<HALJoystickPOVs[]> (kJoystickPorts);
m_joystickButtonsCache = std::make_unique<HALJoystickButtons[]> (kJoystickPorts);
m_joystickDescriptorCache = std::make_unique<HALJoystickDescriptor[]> (kJoystickPorts);
m_joystickAxes = std::make_unique<HALJoystickAxes[]>(kJoystickPorts);
m_joystickPOVs = std::make_unique<HALJoystickPOVs[]>(kJoystickPorts);
m_joystickButtons = std::make_unique<HALJoystickButtons[]>(kJoystickPorts);
m_joystickDescriptor =
std::make_unique<HALJoystickDescriptor[]>(kJoystickPorts);
m_joystickAxesCache = std::make_unique<HALJoystickAxes[]>(kJoystickPorts);
m_joystickPOVsCache = std::make_unique<HALJoystickPOVs[]>(kJoystickPorts);
m_joystickButtonsCache =
std::make_unique<HALJoystickButtons[]>(kJoystickPorts);
m_joystickDescriptorCache =
std::make_unique<HALJoystickDescriptor[]>(kJoystickPorts);
// All joysticks should default to having zero axes, povs and buttons, so
// uninitialized memory doesn't get sent to speed controllers.
@@ -303,7 +306,7 @@ float DriverStation::GetStickAxis(uint32_t stick, uint32_t axis) {
"Joystick Axis missing, check if all controllers are plugged in");
return 0.0f;
}
return m_joystickAxes[stick].axes[axis];
}