summaryrefslogtreecommitdiff
path: root/n
diff options
context:
space:
mode:
authorschodet2006-05-21 00:22:56 +0000
committerschodet2006-05-21 00:22:56 +0000
commit221aee667450528dc2d52400c00c40d30ea2d22d (patch)
treeecbbc46c91614bdb912e66e60bcca1adef53b536 /n
parentd3dc3baf8667c538fab09dc3511d260cad9bc25f (diff)
Changement de l'implémentation du ack.
Diffstat (limited to 'n')
-rw-r--r--n/asserv/src/asserv/main.c12
-rw-r--r--n/asserv/src/asserv/speed.c2
-rw-r--r--n/asserv/src/asserv/traj.c2
3 files changed, 9 insertions, 7 deletions
diff --git a/n/asserv/src/asserv/main.c b/n/asserv/src/asserv/main.c
index cc6fa2c..a58b4b6 100644
--- a/n/asserv/src/asserv/main.c
+++ b/n/asserv/src/asserv/main.c
@@ -33,7 +33,7 @@
#include "misc.h"
/** Motor command sequence. */
-uint8_t main_sequence, main_sequence_ack = 0xff;
+uint8_t main_sequence, main_sequence_ack, main_sequence_finish;
/* This is implementation include. */
#ifndef HOST
@@ -147,9 +147,9 @@ main_loop (void)
speed_update ();
main_timer[3] = timer_read ();
/* Stats. */
- if (main_sequence_ack == main_sequence && !--main_sequence_ack_cpt)
+ if (main_sequence_ack != main_sequence_finish && !--main_sequence_ack_cpt)
{
- proto_send1b ('A', main_sequence);
+ proto_send1b ('A', main_sequence_finish);
main_sequence_ack_cpt = 2;
}
if (main_stat_counter && !--main_stat_counter_cpt)
@@ -285,10 +285,10 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
traj_holes_filter = 0;
main_sequence = args[0];
break;
- case c ('A', 1):
+ case c ('a', 1):
/* Set acknoledge.
- * - b: new sequence number (0 for example). */
- main_sequence = args[0];
+ * - b: ack sequence number. */
+ main_sequence_ack = args[0];
break;
/* Stats.
* - b: interval between stats. */
diff --git a/n/asserv/src/asserv/speed.c b/n/asserv/src/asserv/speed.c
index f9b1d93..596cf35 100644
--- a/n/asserv/src/asserv/speed.c
+++ b/n/asserv/src/asserv/speed.c
@@ -99,6 +99,8 @@ speed_update_by_position (void)
speed_compute_max_speed (speed_alpha_pos_cons - pos_alpha_cons,
speed_alpha_cur, speed_alpha_acc,
speed_alpha_max);
+ if (speed_theta_cur == 0 && speed_alpha_cur == 0)
+ main_sequence_finish = main_sequence;
}
/** Update shaft position consign according to consign. */
diff --git a/n/asserv/src/asserv/traj.c b/n/asserv/src/asserv/traj.c
index 21f60a4..7c4ba65 100644
--- a/n/asserv/src/asserv/traj.c
+++ b/n/asserv/src/asserv/traj.c
@@ -76,7 +76,7 @@ traj_holes (void)
/* Stop. */
speed_theta_cons = 0;
speed_alpha_cons = 0;
- main_sequence_ack = main_sequence;
+ main_sequence_finish = main_sequence;
traj_mode = 12;
}
else if (in & 1)