]> jspc29.x-matter.uni-frankfurt.de Git - coral.git/commitdiff
print also status, when you didn't even have to move
authorMichael Wiebusch <m.wiebusch@gsi.de>
Fri, 9 Jan 2015 16:54:31 +0000 (17:54 +0100)
committerMichael Wiebusch <m.wiebusch@gsi.de>
Fri, 9 Jan 2015 16:54:31 +0000 (17:54 +0100)
firmware/plate.c

index b5b15ee270ab90c7ad5d48c4a61071bd9f20d42a..944c780a2d4b33e9a54af2a623132f8f9ed3a168 100644 (file)
@@ -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;