summaryrefslogtreecommitdiff
path: root/n/asserv/src/goto.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/asserv/src/goto.c')
-rw-r--r--n/asserv/src/goto.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/n/asserv/src/goto.c b/n/asserv/src/goto.c
index 8aa5e91..c427af9 100644
--- a/n/asserv/src/goto.c
+++ b/n/asserv/src/goto.c
@@ -44,6 +44,8 @@ int8_t goto_s;
int32_t goto_eps = 20L << 8;
/** Debug values. */
int32_t goto_dx, goto_dy, goto_dl, goto_da;
+/** Movement finished. */
+uint8_t goto_finish;
/* +AutoDec */
/* -AutoDec */
@@ -65,6 +67,7 @@ goto_linear_mode (void)
{
speed_left_aim = 0;
speed_right_aim = 0;
+ goto_finish = 1;
}
else
{
@@ -104,6 +107,7 @@ goto_position_mode (void)
{
speed_left_aim = 0;
speed_right_aim = 0;
+ goto_finish = 1;
}
else
{
@@ -130,6 +134,7 @@ goto_position_exact_mode (void)
{
speed_left_aim = 0;
speed_right_aim = 0;
+ goto_finish = 1;
}
else
{
@@ -166,6 +171,8 @@ goto_ftw_mode (void)
speed_right = 0;
speed_right_aim = 0;
}
+ if (!(PINC & (_BV (0) || _BV (7))))
+ goto_finish = 1;
}
/** Update the speed according to the desired destination. */