summaryrefslogtreecommitdiffhomepage
path: root/digital/io-hub/src/apbirthday
diff options
context:
space:
mode:
authorJerome Jutteau2013-05-01 17:59:47 +0200
committerJerome Jutteau2013-05-01 17:59:47 +0200
commit0c8f1f4ba219c8f92ed5b1e7c7ad0f967d4150a2 (patch)
tree3d190947b6f9e9e78f97660c94cb47418e73838b /digital/io-hub/src/apbirthday
parent5ba738d4fe93ea04f259badb38343c5e2fb6168e (diff)
digital/io-hub/src/apbirthday: add plate state
Diffstat (limited to 'digital/io-hub/src/apbirthday')
-rw-r--r--digital/io-hub/src/apbirthday/plate.cc3
-rw-r--r--digital/io-hub/src/apbirthday/plate.hh2
2 files changed, 5 insertions, 0 deletions
diff --git a/digital/io-hub/src/apbirthday/plate.cc b/digital/io-hub/src/apbirthday/plate.cc
index 8fda068b..9b38b771 100644
--- a/digital/io-hub/src/apbirthday/plate.cc
+++ b/digital/io-hub/src/apbirthday/plate.cc
@@ -28,6 +28,7 @@
Plate::Plate ()
{
reset_plate_nb ();
+ is_up = 0;
}
inline int Plate::get_plate_nb ()
@@ -141,6 +142,7 @@ FSM_TRANS_TIMEOUT (PLATE_TAKE_UPING, 100, PLATE_I_HAZ_PLATE)
{
robot->fsm_queue.post (FSM_EVENT (plate_taken));
robot->plate.ppp ();
+ robot->plate.is_up = 1;
}
FSM_TRANS (PLATE_I_HAZ_PLATE, plate_take, PLATE_I_HAZ_PLATE)
@@ -151,6 +153,7 @@ FSM_TRANS (PLATE_I_HAZ_PLATE, plate_take, PLATE_I_HAZ_PLATE)
FSM_TRANS (PLATE_I_HAZ_PLATE, plate_drop, PLATE_DROP_DOWNING)
{
Plate::arm_down ();
+ robot->plate.is_up = 0;
}
FSM_TRANS_TIMEOUT (PLATE_DROP_DOWNING, 100, PLATE_DROP_OPENING)
diff --git a/digital/io-hub/src/apbirthday/plate.hh b/digital/io-hub/src/apbirthday/plate.hh
index 614c1790..b4538253 100644
--- a/digital/io-hub/src/apbirthday/plate.hh
+++ b/digital/io-hub/src/apbirthday/plate.hh
@@ -33,6 +33,8 @@ class Plate
void reset_plate_nb ();
// Increment plate_nb, internal use for FSM
void ppp ();
+ // Read only: 1 if plate is up, 0 otherwhise
+ int is_up;
// GPIO manipulation.
static void arm_down ();
static void arm_up ();