summaryrefslogtreecommitdiff
path: root/n/asserv/src/main.c
diff options
context:
space:
mode:
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). */