summaryrefslogtreecommitdiff
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.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/digital/io-hub/src/apbirthday/robot.cc b/digital/io-hub/src/apbirthday/robot.cc
index 8ed99782..36629698 100644
--- a/digital/io-hub/src/apbirthday/robot.cc
+++ b/digital/io-hub/src/apbirthday/robot.cc
@@ -43,6 +43,7 @@ Robot::Robot ()
chrono (90000 - 1000),
pressure (hardware.adc_pressure, hardware.pneum_open, mimot.motor0),
jack (hardware.raw_jack, 50),
+ demo (false),
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),
@@ -171,6 +172,9 @@ Robot::fsm_gen_event ()
fsm_handle_and_return (jack_inserted);
else
fsm_handle_and_return (jack_removed);
+ // Demo mode.
+ if (demo && demo_fsm_gen_event ())
+ return true;
// FSM queue.
if (fsm_queue.poll ())
{
@@ -187,6 +191,14 @@ Robot::fsm_gen_event ()
return false;
}
+bool
+Robot::demo_fsm_gen_event ()
+{
+ if (robot->hardware.ihm_strat.get ())
+ fsm_handle_and_return (top_demo_candles);
+ return false;
+}
+
void
Robot::proto_handle (ucoo::Proto &proto, char cmd, const uint8_t *args, int size)
{