Get rid of //aos/prime
It's not a useful distinction to make any more.
Change-Id: Ieacfe8af4502108b8a5949234a1a3b6a6dd7b7e9
diff --git a/aos/input/joystick_input.cc b/aos/input/joystick_input.cc
new file mode 100644
index 0000000..a6ada96
--- /dev/null
+++ b/aos/input/joystick_input.cc
@@ -0,0 +1,66 @@
+#include "aos/input/joystick_input.h"
+
+#include <string.h>
+
+#include "aos/common/messages/robot_state.q.h"
+#include "aos/common/logging/logging.h"
+#include "aos/common/logging/queue_logging.h"
+
+namespace aos {
+namespace input {
+
+void JoystickInput::Run() {
+ driver_station::Data data;
+ while (true) {
+ joystick_state.FetchAnother();
+
+ data.Update(*joystick_state);
+
+ {
+ using driver_station::JoystickFeature;
+ using driver_station::ButtonLocation;
+ for (int joystick = 1; joystick <= JoystickFeature::kJoysticks;
+ ++joystick) {
+ for (int button = 1; button <= ButtonLocation::kButtons; ++button) {
+ ButtonLocation location(joystick, button);
+ if (data.PosEdge(location)) {
+ LOG(INFO, "PosEdge(%d, %d)\n", joystick, button);
+ }
+ if (data.NegEdge(location)) {
+ LOG(INFO, "NegEdge(%d, %d)\n", joystick, button);
+ }
+ }
+ if (data.GetPOV(joystick) != data.GetOldPOV(joystick)) {
+ LOG(INFO, "POV %d %d->%d\n", joystick, data.GetOldPOV(joystick),
+ data.GetPOV(joystick));
+ }
+ }
+ }
+ {
+ using driver_station::ControlBit;
+ if (data.PosEdge(ControlBit::kFmsAttached)) {
+ LOG(INFO, "PosEdge(kFmsAttached)\n");
+ }
+ if (data.NegEdge(ControlBit::kFmsAttached)) {
+ LOG(INFO, "NegEdge(kFmsAttached)\n");
+ }
+ if (data.PosEdge(ControlBit::kAutonomous)) {
+ LOG(INFO, "PosEdge(kAutonomous)\n");
+ }
+ if (data.NegEdge(ControlBit::kAutonomous)) {
+ LOG(INFO, "NegEdge(kAutonomous)\n");
+ }
+ if (data.PosEdge(ControlBit::kEnabled)) {
+ LOG(INFO, "PosEdge(kEnabled)\n");
+ }
+ if (data.NegEdge(ControlBit::kEnabled)) {
+ LOG(INFO, "NegEdge(kEnabled)\n");
+ }
+ }
+
+ RunIteration(data);
+ }
+}
+
+} // namespace input
+} // namespace aos