Expose roborio user button in RobotState
Change-Id: I8254f4f24fc7b699cada7739002fc9ed5916a834
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/frc971/input/robot_state.fbs b/frc971/input/robot_state.fbs
index 7d0199b..52a8a08 100644
--- a/frc971/input/robot_state.fbs
+++ b/frc971/input/robot_state.fbs
@@ -30,6 +30,9 @@
// From the DriverStation object, aka what FMS sees and what shows up on the
// actual driver's station.
voltage_battery:double (id: 8);
+
+ // User button state
+ user_button:bool (id: 9);
}
root_type RobotState;
diff --git a/frc971/wpilib/wpilib_interface.cc b/frc971/wpilib/wpilib_interface.cc
index 2a59019..d1703ce 100644
--- a/frc971/wpilib/wpilib_interface.cc
+++ b/frc971/wpilib/wpilib_interface.cc
@@ -3,6 +3,7 @@
#include "aos/events/event_loop.h"
#include "aos/logging/logging.h"
#include "frc971/input/robot_state_generated.h"
+#include "frc971/wpilib/ahal/Utility.h"
#include "hal/HAL.h"
namespace frc971 {
@@ -26,6 +27,7 @@
robot_state_builder.add_voltage_roborio_in(HAL_GetVinVoltage(&status));
robot_state_builder.add_voltage_battery(HAL_GetVinVoltage(&status));
+ robot_state_builder.add_user_button(frc::GetUserButton());
if (status != 0) {
AOS_LOG(FATAL, "Failed to get robot state: %d\n", status);