From 030efe675d8209afbf63b9211fae2718f2604803 Mon Sep 17 00:00:00 2001 From: Michael Wiebusch Date: Fri, 9 Jan 2015 17:54:31 +0100 Subject: [PATCH] print also status, when you didn't even have to move --- firmware/plate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firmware/plate.c b/firmware/plate.c index b5b15ee..944c780 100644 --- a/firmware/plate.c +++ b/firmware/plate.c @@ -15,6 +15,7 @@ volatile int32_t plate_pos_x = 0,plate_pos_y = 0; volatile int32_t target_plate_pos_x = 0,target_plate_pos_y = 0; uint8_t ready = 0; +uint8_t busy = 0; int32_t get_plate_pos_x(void){ return plate_pos_x; @@ -36,15 +37,19 @@ int32_t get_target_plate_pos_y(void){ } void set_target_plate_pos_x(int32_t value){ target_plate_pos_x = value; + busy = 1; } void set_target_plate_pos_y(int32_t value){ target_plate_pos_y = value; + busy = 1; } void inc_target_plate_pos_x(int32_t value){ target_plate_pos_x += value; + busy = 1; } void inc_target_plate_pos_y(int32_t value){ target_plate_pos_y += value; + busy = 1; } uint8_t plate_ready(void){ @@ -61,7 +66,6 @@ uint8_t plate_ready(void){ uint8_t move_plate(void){ int32_t todo_x,todo_y = 0; int8_t signum; - static uint8_t busy = 0; todo_x = target_plate_pos_x-plate_pos_x; todo_y = target_plate_pos_y-plate_pos_y; -- 2.43.0