summaryrefslogtreecommitdiffhomepage
path: root/digital/io-hub/src/apbirthday/robot.cc
diff options
context:
space:
mode:
Diffstat (limited to 'digital/io-hub/src/apbirthday/robot.cc')
-rw-r--r--digital/io-hub/src/apbirthday/robot.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/digital/io-hub/src/apbirthday/robot.cc b/digital/io-hub/src/apbirthday/robot.cc
index ced1b0c8..bc0c3552 100644
--- a/digital/io-hub/src/apbirthday/robot.cc
+++ b/digital/io-hub/src/apbirthday/robot.cc
@@ -40,6 +40,7 @@ Robot::Robot ()
usb_proto (*this, hardware.usb),
chrono (90000 - 1000),
pressure (hardware.adc_pressure, hardware.pneum_open, mimot.motor0),
+ jack (hardware.raw_jack, 50),
usdist_control_ (2),
usdist0_ (usdist_control_, hardware.adc_dist0, hardware.dist0_sync, 100, 700, 650),
usdist1_ (usdist_control_, hardware.adc_dist1, hardware.dist1_sync, 100, 700, 650),
@@ -125,6 +126,7 @@ Robot::main_loop ()
}
obstacles.update ();
pressure.update ();
+ jack.update ();
outputs_set_.update ();
// Handle communications.
bool sync = main_i2c_queue_.sync ();
@@ -163,8 +165,8 @@ Robot::fsm_gen_event ()
fsm_handle_and_return (robot_move_success);
else if (robot_move_status == Motor::FAILURE)
fsm_handle_and_return (robot_move_failure);
- // Jack. TODO: bounce filter.
- if (!hardware.raw_jack.get ())
+ // Jack.
+ if (!jack.get ())
fsm_handle_and_return (jack_inserted);
else
fsm_handle_and_return (jack_removed);