diff --git a/wpilibc/src/main/native/cpp/ControllerPower.cpp b/wpilibc/src/main/native/cpp/ControllerPower.cpp deleted file mode 100644 index d3012eaeff..0000000000 --- a/wpilibc/src/main/native/cpp/ControllerPower.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2011-2018 FIRST. 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 the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "frc/ControllerPower.h" - -#include - -#include -#include - -#include "frc/ErrorBase.h" - -using namespace frc; - -double ControllerPower::GetInputVoltage() { - int32_t status = 0; - double retVal = HAL_GetVinVoltage(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetInputCurrent() { - int32_t status = 0; - double retVal = HAL_GetVinCurrent(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetVoltage3V3() { - int32_t status = 0; - double retVal = HAL_GetUserVoltage3V3(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetCurrent3V3() { - int32_t status = 0; - double retVal = HAL_GetUserCurrent3V3(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -bool ControllerPower::GetEnabled3V3() { - int32_t status = 0; - bool retVal = HAL_GetUserActive3V3(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -int ControllerPower::GetFaultCount3V3() { - int32_t status = 0; - int retVal = HAL_GetUserCurrentFaults3V3(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetVoltage5V() { - int32_t status = 0; - double retVal = HAL_GetUserVoltage5V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetCurrent5V() { - int32_t status = 0; - double retVal = HAL_GetUserCurrent5V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -bool ControllerPower::GetEnabled5V() { - int32_t status = 0; - bool retVal = HAL_GetUserActive5V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -int ControllerPower::GetFaultCount5V() { - int32_t status = 0; - int retVal = HAL_GetUserCurrentFaults5V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetVoltage6V() { - int32_t status = 0; - double retVal = HAL_GetUserVoltage6V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetCurrent6V() { - int32_t status = 0; - double retVal = HAL_GetUserCurrent6V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -bool ControllerPower::GetEnabled6V() { - int32_t status = 0; - bool retVal = HAL_GetUserActive6V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -int ControllerPower::GetFaultCount6V() { - int32_t status = 0; - int retVal = HAL_GetUserCurrentFaults6V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} diff --git a/wpilibc/src/main/native/cpp/DriverStation.cpp b/wpilibc/src/main/native/cpp/DriverStation.cpp index 3c274c6ef0..1565653a1b 100644 --- a/wpilibc/src/main/native/cpp/DriverStation.cpp +++ b/wpilibc/src/main/native/cpp/DriverStation.cpp @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */ +/* Copyright (c) 2008-2019 FIRST. 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 the root directory of */ /* the project. */ @@ -368,20 +368,6 @@ bool DriverStation::IsFMSAttached() const { return controlWord.fmsAttached; } -bool DriverStation::IsSysActive() const { - int32_t status = 0; - bool retVal = HAL_GetSystemActive(&status); - wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -bool DriverStation::IsBrownedOut() const { - int32_t status = 0; - bool retVal = HAL_GetBrownedOut(&status); - wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - std::string DriverStation::GetGameSpecificMessage() const { HAL_MatchInfo info; HAL_GetMatchInfo(&info); diff --git a/wpilibc/src/main/native/cpp/GamepadBase.cpp b/wpilibc/src/main/native/cpp/GamepadBase.cpp deleted file mode 100644 index 4eeb7442b2..0000000000 --- a/wpilibc/src/main/native/cpp/GamepadBase.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2016-2018 FIRST. 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 the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "frc/GamepadBase.h" - -using namespace frc; - -GamepadBase::GamepadBase(int port) : GenericHID(port) {} diff --git a/wpilibc/src/main/native/cpp/Joystick.cpp b/wpilibc/src/main/native/cpp/Joystick.cpp index da77d94657..7c95a05803 100644 --- a/wpilibc/src/main/native/cpp/Joystick.cpp +++ b/wpilibc/src/main/native/cpp/Joystick.cpp @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */ +/* Copyright (c) 2008-2019 FIRST. 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 the root directory of */ /* the project. */ @@ -40,10 +40,6 @@ void Joystick::SetThrottleChannel(int channel) { m_axes[Axis::kThrottle] = channel; } -void Joystick::SetAxisChannel(AxisType axis, int channel) { - m_axes[axis] = channel; -} - int Joystick::GetXChannel() const { return m_axes[Axis::kX]; } int Joystick::GetYChannel() const { return m_axes[Axis::kY]; } @@ -70,24 +66,6 @@ double Joystick::GetThrottle() const { return GetRawAxis(m_axes[Axis::kThrottle]); } -double Joystick::GetAxis(AxisType axis) const { - switch (axis) { - case kXAxis: - return GetX(); - case kYAxis: - return GetY(); - case kZAxis: - return GetZ(); - case kTwistAxis: - return GetTwist(); - case kThrottleAxis: - return GetThrottle(); - default: - wpi_setWPIError(BadJoystickAxis); - return 0.0; - } -} - bool Joystick::GetTrigger() const { return GetRawButton(Button::kTrigger); } bool Joystick::GetTriggerPressed() { @@ -104,22 +82,6 @@ bool Joystick::GetTopPressed() { return GetRawButtonPressed(Button::kTop); } bool Joystick::GetTopReleased() { return GetRawButtonReleased(Button::kTop); } -Joystick* Joystick::GetStickForPort(int port) { - static std::array, DriverStation::kJoystickPorts> - joysticks{}; - auto stick = joysticks[port].get(); - if (stick == nullptr) { - joysticks[port] = std::make_unique(port); - stick = joysticks[port].get(); - } - return stick; -} - -bool Joystick::GetButton(ButtonType button) const { - int temp = button; - return GetRawButton(static_cast