summaryrefslogtreecommitdiff
path: root/n/asserv/src/main.c
diff options
context:
space:
mode:
authorschodet2005-04-27 18:37:57 +0000
committerschodet2005-04-27 18:37:57 +0000
commitf0ccf37dce1373d0e3ca70a68772de98ed67d995 (patch)
tree5a15b67f1486043eb57bc06511596f2d70c95a41 /n/asserv/src/main.c
parent62c6ae5cd97f7fa85709eba90a01a7cddd6685a5 (diff)
Modif des compteurs.
Modif de Taz.
Diffstat (limited to 'n/asserv/src/main.c')
-rw-r--r--n/asserv/src/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/n/asserv/src/main.c b/n/asserv/src/main.c
index 7650014..fe99acf 100644
--- a/n/asserv/src/main.c
+++ b/n/asserv/src/main.c
@@ -30,6 +30,7 @@
#include <n/avr/twi-master/twi_master.h>
#include <avr/interrupt.h>
#include <avr/io.h>
+#include <avr/signal.h>
#include "pwm.c"
#include "timer.c"
@@ -118,8 +119,9 @@ main_loop (void)
while (1)
{
motor_timer_0 = timer_read ();
+ /* Counter update. */
while (!timer_pending ())
- counter_poll ();
+ ;
counter_update ();
motor_timer_4 = timer_read ();
/* Position tracking. */
@@ -214,9 +216,16 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
reset ();
break;
/* Commands. */
+ case c ('t', 0):
+ proto_send2b ('t', taz_state, taz_substate);
+ break;
case c ('t', 1):
motor_taz = args[0];
break;
+ case c ('t', 2):
+ taz_max_state = args[0];
+ taz_max_substate = args[1];
+ break;
case c ('l', 2):
/* Linear move.
* - w: distance (negative to go backward). */