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.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/n/asserv/src/main.c b/n/asserv/src/main.c
index d119e4b..fb6b2d4 100644
--- a/n/asserv/src/main.c
+++ b/n/asserv/src/main.c
@@ -64,6 +64,9 @@ uint8_t motor_stat_pwm, motor_stat_pwm_cpt;
/** Report of timer. */
uint8_t motor_stat_timer, motor_stat_timer_cpt;
+/** Print PINC. */
+uint8_t motor_print_pinc, motor_print_pinc_cpt;
+
/** Record timer value at different stage of computing. Used for performance
* analisys. */
uint8_t motor_timer_0, motor_timer_1, motor_timer_2, motor_timer_3,
@@ -159,6 +162,11 @@ main_loop (void)
motor_timer_1, motor_timer_0);
motor_stat_timer_cpt = motor_stat_timer;
}
+ if (motor_print_pinc && !--motor_print_pinc_cpt)
+ {
+ proto_send1b ('P', PINC);
+ motor_print_pinc_cpt = motor_print_pinc;
+ }
/* Misc. */
if ((motor_loop_cpt & 7) == 0)
{
@@ -200,6 +208,11 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
goto_x = v8_to_v32 (args[0], args[1], args[2], args[3]);
goto_y = v8_to_v32 (args[4], args[5], args[6], args[7]);
break;
+ case c ('f', 1):
+ motor_mode = 2;
+ goto_mode = 10;
+ goto_s = args[0];
+ break;
case c ('s', 0):
motor_mode = 1;
speed_left_aim = 0;
@@ -246,6 +259,9 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
case c ('T', 1):
motor_stat_timer_cpt = motor_stat_timer = args[0];
break;
+ case c ('P', 1):
+ motor_print_pinc_cpt = motor_print_pinc = args[0];
+ break;
default:
/* Params. */
if (cmd == 'p')
@@ -273,6 +289,12 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
case c ('i', 3):
speed_ki = v8_to_v16 (args[1], args[2]);
break;
+ case c ('d', 3):
+ speed_dead_zone = v8_to_v16 (args[1], args[2]);
+ break;
+ case c ('I', 3):
+ speed_int_max = v8_to_v16 (args[1], args[2]);
+ break;
case c ('a', 2):
speed_acc_cpt = speed_acc = args[1];
break;