Added the getButtons method back that reads all the buttons at the same time

Change-Id: I0f7f35b6a70f861911166de7be3802547ff4b2eb
This commit is contained in:
Brad Miller
2014-12-18 10:57:11 -05:00
parent 786e844a9f
commit c17ba98f72
3 changed files with 34 additions and 0 deletions

View File

@@ -283,6 +283,24 @@ int DriverStation::GetStickPOV(uint32_t stick, uint32_t pov) {
* @param stick The joystick to read.
* @return The state of the buttons on the joystick.
*/
uint32_t DriverStation::GetStickButtons(uint32_t stick)
{
if (stick >= kJoystickPorts)
{
wpi_setWPIError(BadJoystickIndex);
return 0;
}
return m_joystickButtons[stick].buttons;
}
/**
* The state of one joystick button. Button indexes begin at 1.
*
* @param stick The joystick to read.
* @param button The button index, beginning at 1.
* @return The state of the joystick button.
*/
bool DriverStation::GetStickButton(uint32_t stick, uint8_t button)
{
if (stick >= kJoystickPorts)