Convert joystick_reader over to event loops.
Change-Id: I97b78254b0fc96853f162b66ef75ec97a6c9c50b
diff --git a/y2012/joystick_reader.cc b/y2012/joystick_reader.cc
index e48eaf6..46b20f6 100644
--- a/y2012/joystick_reader.cc
+++ b/y2012/joystick_reader.cc
@@ -3,12 +3,13 @@
#include <unistd.h>
#include <math.h>
+#include "aos/actions/actions.h"
+#include "aos/events/shm-event-loop.h"
#include "aos/init.h"
-#include "aos/input/joystick_input.h"
#include "aos/input/driver_station_data.h"
+#include "aos/input/joystick_input.h"
#include "aos/logging/logging.h"
#include "aos/time/time.h"
-#include "aos/actions/actions.h"
#include "frc971/control_loops/drivetrain/drivetrain.q.h"
#include "y2012/control_loops/accessories/accessories.q.h"
@@ -80,8 +81,8 @@
class Reader : public ::aos::input::JoystickInput {
public:
- Reader()
- : is_high_gear_(false) {}
+ Reader(::aos::EventLoop *event_loop)
+ : ::aos::input::JoystickInput(event_loop), is_high_gear_(false) {}
void RunIteration(const ::aos::input::driver_station::Data &data) override {
if (!data.GetControlBit(ControlBit::kAutonomous)) {
@@ -144,7 +145,8 @@
int main() {
::aos::Init(-1);
- ::y2012::input::joysticks::Reader reader;
+ ::aos::ShmEventLoop event_loop;
+ ::y2012::input::joysticks::Reader reader(&event_loop);
reader.Run();
::aos::Cleanup();
}