From 0d655d7cec65b1647410f291158e3bd1ca0135bf Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Sun, 22 May 2016 21:39:33 -0700 Subject: [PATCH] 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. --- hal/lib/shared/HAL.cpp | 12 ++++++------ wpilibc/athena/include/CANTalon.h | 1 + wpilibc/athena/src/DriverStation.cpp | 21 ++++++++++++--------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/hal/lib/shared/HAL.cpp b/hal/lib/shared/HAL.cpp index edc4040b04..e4099e48e5 100644 --- a/hal/lib/shared/HAL.cpp +++ b/hal/lib/shared/HAL.cpp @@ -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; } diff --git a/wpilibc/athena/include/CANTalon.h b/wpilibc/athena/include/CANTalon.h index 82d5f069b8..4ff86fcdd6 100644 --- a/wpilibc/athena/include/CANTalon.h +++ b/wpilibc/athena/include/CANTalon.h @@ -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 diff --git a/wpilibc/athena/src/DriverStation.cpp b/wpilibc/athena/src/DriverStation.cpp index 14a962dcbc..5d2644f7b0 100644 --- a/wpilibc/athena/src/DriverStation.cpp +++ b/wpilibc/athena/src/DriverStation.cpp @@ -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 (kJoystickPorts); - m_joystickPOVs = std::make_unique (kJoystickPorts); - m_joystickButtons = std::make_unique (kJoystickPorts); - m_joystickDescriptor = std::make_unique (kJoystickPorts); - m_joystickAxesCache = std::make_unique (kJoystickPorts); - m_joystickPOVsCache = std::make_unique (kJoystickPorts); - m_joystickButtonsCache = std::make_unique (kJoystickPorts); - m_joystickDescriptorCache = std::make_unique (kJoystickPorts); + m_joystickAxes = std::make_unique(kJoystickPorts); + m_joystickPOVs = std::make_unique(kJoystickPorts); + m_joystickButtons = std::make_unique(kJoystickPorts); + m_joystickDescriptor = + std::make_unique(kJoystickPorts); + m_joystickAxesCache = std::make_unique(kJoystickPorts); + m_joystickPOVsCache = std::make_unique(kJoystickPorts); + m_joystickButtonsCache = + std::make_unique(kJoystickPorts); + m_joystickDescriptorCache = + std::make_unique(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]; }