]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
lift: chybny vypocet pozice
authorJarda Sach <jarin@work.(none)>
Thu, 9 Apr 2009 11:16:22 +0000 (13:16 +0200)
committerJarda Sach <jarin@work.(none)>
Thu, 9 Apr 2009 11:16:22 +0000 (13:16 +0200)
src/eb_vytah_09/pusher.c
src/eb_vytah_09/pusher.h

index 3985a78c32f9418a0edd4c030c37bfb5f63f62e1..6aeb85d4c33352429f79b0eb7ff1db9b3da0c2b2 100644 (file)
@@ -134,7 +134,10 @@ void move_pusher_pos(struct fsm *fsm, events my_event){
                        if(cnt_IRC_pusher >= match_IRC_pusher){
                                sbit(flags, PUSHER_ON_POS);//stop motors, set flag position OK
                                move_pusher(ENGINE_FW, 0);// stop moving 
-                               act_position_pusher = cnt_IRC_pusher;
+                               if(pusher_dir == ENGINE_FW)
+                                       act_position_pusher += cnt_IRC_pusher;
+                               else
+                                       act_position_pusher -= cnt_IRC_pusher; 
                                fsm->current_state = &stop_pusher;//set new state 
                        }// pozooor druha jednotka
 
index 9a501271870af9cff07302fdffc895d2ea7a0b5c..ff2192727c34ce2b0f39ef8c94c17ee27847047a 100644 (file)
@@ -3,6 +3,13 @@
 
 #include "def.h"
 
+unsigned char  pusher_dir, last_pusher_dir;
+volatile unsigned int act_position_pusher, last_position_pusher, req_position_pusher;
+unsigned volatile int  match_IRC_pusher, cnt_IRC_pusher;       //register which cnt_IRC will be compared with
+volatile uint32_t  can_req_position_pusher;    
+
+
+
 //************************************************************************************
 //******************** declaration of interrupt service rutines **********************
 //************************************************************************************
 
        
        
-unsigned char  pusher_dir;
-volatile unsigned int act_position_pusher, last_position_pusher, req_position_pusher;
-unsigned volatile int  match_IRC_pusher, cnt_IRC_pusher;       //register which cnt_IRC will be compared with
-volatile uint32_t  can_req_position_pusher;    
-       
+
 
 #endif /*__PUSHER_H*/