summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2008-04-25 21:27:04 +0200
committerNicolas Schodet2008-04-25 21:27:04 +0200
commit8260f152b5266c7ae82598fcbb4ce28ea44f5ed3 (patch)
treeac542d50c4625f94e9585081bce745baada94d02
parent9815f8326fe963bd00c7ec75269103b5cdeef1eb (diff)
* digital/asserv/src/asserv:
- added movement direction bits in status.
-rw-r--r--digital/asserv/src/asserv/twi_proto.c4
-rw-r--r--digital/io/doc/proto_asserv.txt6
2 files changed, 9 insertions, 1 deletions
diff --git a/digital/asserv/src/asserv/twi_proto.c b/digital/asserv/src/asserv/twi_proto.c
index 76639064..3be0367e 100644
--- a/digital/asserv/src/asserv/twi_proto.c
+++ b/digital/asserv/src/asserv/twi_proto.c
@@ -71,7 +71,9 @@ twi_proto_update (void)
twi_proto_callback (buf, sizeof (buf));
/* Update status. */
u8 status[12];
- status[0] = (state_aux0.blocked << 3)
+ status[0] = (speed_theta.cons < 0 ? (1 << 5) : 0)
+ | (speed_theta.cons > 0 ? (1 << 4) : 0)
+ | (state_aux0.blocked << 3)
| (state_aux0.finished << 2)
| (state_main.blocked << 1)
| (state_main.finished << 0);
diff --git a/digital/io/doc/proto_asserv.txt b/digital/io/doc/proto_asserv.txt
index 2fffb618..dd78003c 100644
--- a/digital/io/doc/proto_asserv.txt
+++ b/digital/io/doc/proto_asserv.txt
@@ -159,6 +159,12 @@ Here is a list of the bits used and their definitions:
3. Arm movement finished with failure: it should not happen, but we are not
sure yet (AB).
+ 4. Movement is going forward: the current linear speed is greater than 0
+ (FWD) ;
+
+ 5. Movement is going backward: the current linear speed is smaller than 0
+ (BCK) ;
+
The others bits are unused.