summaryrefslogtreecommitdiff
path: root/digital/io-hub
diff options
context:
space:
mode:
authorJérôme Jutteau2011-05-30 18:39:12 +0200
committerJérôme Jutteau2011-05-30 18:39:12 +0200
commit3eeefad855e75c09a62579b3d2cbf51894d137ca (patch)
tree4de55f73e0a23895ffd923e05f75515f2a13d482 /digital/io-hub
parent69bae8c81600790e5593facf92be774458d7b7c7 (diff)
digital/io-hub: added some logistic dump and little fix in top
Diffstat (limited to 'digital/io-hub')
-rw-r--r--digital/io-hub/src/robospierre/logistic.c12
-rw-r--r--digital/io-hub/src/robospierre/top.c3
2 files changed, 13 insertions, 2 deletions
diff --git a/digital/io-hub/src/robospierre/logistic.c b/digital/io-hub/src/robospierre/logistic.c
index 35e40efa..a9712c23 100644
--- a/digital/io-hub/src/robospierre/logistic.c
+++ b/digital/io-hub/src/robospierre/logistic.c
@@ -293,12 +293,18 @@ logistic_decision (void)
/* Clamp is broken, can't move anything. */
if (ctx.prepare == 3)
+ {
+ logistic_debug_dump ();
return;
+ }
/* We founded a tower ! */
logistic_new_tower ();
if (ctx.ready)
+ {
+ logistic_debug_dump ();
return;
+ }
/* Check if we really need to prepare something. */
logistic_check_need_prepare ();
@@ -316,6 +322,7 @@ logistic_decision (void)
ctx.collect_direction = DIRECTION_BACKWARD;
ctx.clamp_pos_idle = CLAMP_SLOT_BACK_MIDDLE;
}
+ logistic_debug_dump ();
return;
}
if (ELEMENT_IS_HEAD (ctx.slots[CLAMP_SLOT_BACK_BOTTOM]) &&
@@ -328,6 +335,7 @@ logistic_decision (void)
ctx.collect_direction = DIRECTION_FORWARD;
ctx.clamp_pos_idle = CLAMP_SLOT_FRONT_MIDDLE;
}
+ logistic_debug_dump ();
return;
}
}
@@ -377,6 +385,7 @@ logistic_decision (void)
{
/* Build is finished. */
ctx.ready = 1;
+ logistic_debug_dump ();
return;
}
/* Source. */
@@ -388,6 +397,7 @@ logistic_decision (void)
ctx.moving_from = collect_bay;
else if (ctx.slots[CLAMP_SLOT_SIDE])
ctx.moving_from = CLAMP_SLOT_SIDE;
+ logistic_debug_dump ();
return;
}
/* We have to prepare an element to put out. */
@@ -455,7 +465,7 @@ logistic_init (void)
ctx.moving_from = ctx.moving_to = CLAMP_SLOT_NB;
ctx.collect_direction = DIRECTION_FORWARD;
ctx.construct_possible = 0;
- ctx.prepare = 0;
+ ctx.prepare = 1;
ctx.ready = 0;
ctx.need_prepare = 0;
}
diff --git a/digital/io-hub/src/robospierre/top.c b/digital/io-hub/src/robospierre/top.c
index 78bb06aa..5c10a0f3 100644
--- a/digital/io-hub/src/robospierre/top.c
+++ b/digital/io-hub/src/robospierre/top.c
@@ -128,7 +128,8 @@ top_go_drop (void)
static uint8_t
top_decision (void)
{
- if (logistic_global.tower_possible)
+ /* If we can make a tower. */
+ if (logistic_global.construct_possible == 1)
return top_go_drop ();
else
return top_go_element ();