Programme carte strategie (disco)

Dependencies:   mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac

Revision:
41:b029ddc4d60e
Parent:
40:21bb685b553b
Child:
42:657b6a573e11
--- a/Strategie/Strategie.cpp	Thu May 10 18:49:25 2018 +0000
+++ b/Strategie/Strategie.cpp	Fri May 11 12:09:26 2018 +0000
@@ -155,7 +155,7 @@
 void Setflag(void);
 void can2Rx_ISR(void);
 signed char Bouton_Strat (void);
-
+signed char blocage_balise;
 void print_segment(int nombre, int decalage);
 void affichage_compteur (int nombre);
 void effacer_segment(long couleur);
@@ -213,6 +213,7 @@
     if(gameEtat == ETAT_GAME_WAIT_FOR_JACK) {
         gameEtat = ETAT_GAME_START;//On débute le match
         etat=COMPTEUR;
+        blocage_balise=1;
     }
 }
 
@@ -1172,7 +1173,7 @@
                         #ifdef ROBOT_SMALL   
                         GoStraight(-450, 0, 0, 0);
                         #else 
-                        GoStraight(75, 0, 0, 0);
+                        GoStraight(150, 0, 0, 0);
                         #endif
                         while(waitingAckID !=0 && waitingAckFrom !=0)
                             canProcessRx();
@@ -1543,13 +1544,13 @@
                     }
                 } 
                 else if(instruction.nextActionType == WAIT) {   ///Actualisation des waiting ack afin d'attendre la fin des actions
-                    wait_ms(200);
+                    /*wait_ms(200);
                     #ifdef ROBOT_BIG
                         SetOdometrie(ODOMETRIE_BIG_POSITION, x_robot, y_robot, theta_robot);
                     #else
                         SetOdometrie(ODOMETRIE_SMALL_POSITION, x_robot, y_robot, theta_robot);
                     #endif
-                    wait_ms(200);
+                    wait_ms(200);*/
                     
                     gameEtat = ETAT_GAME_WAIT_END_INSTRUCTION;
                     switch(instruction.order)
@@ -1699,13 +1700,13 @@
 #endif      
             gameEtat = ETAT_END;*/
             
-            wait_ms(200);
+            /*wait_ms(200);
             #ifdef ROBOT_BIG
                 SetOdometrie(ODOMETRIE_BIG_POSITION, x_robot, y_robot, theta_robot);
             #else
                 SetOdometrie(ODOMETRIE_SMALL_POSITION, x_robot, y_robot, theta_robot);
             #endif
-            wait_ms(200);
+            wait_ms(200);*/
             
             switch(actionPrecedente){
                 case MV_LINE:
@@ -2068,11 +2069,18 @@
                 break;
             
             case RECEPTION_COULEUR:
+                if (blocage_balise==0){
                 couleur1=msgRxBuffer[FIFO_lecture].data[0];
                 couleur2=msgRxBuffer[FIFO_lecture].data[1];
                 couleur3=msgRxBuffer[FIFO_lecture].data[2]; 
+                
+                /*lcd.DisplayStringAt(0,LINE(16),(unsigned char *)couleur1+'0',LEFT_MODE);
+                lcd.DisplayStringAt(0,LINE(16+1),(unsigned char *)couleur2+'0',LEFT_MODE);
+                lcd.DisplayStringAt(0,LINE(16+2),(unsigned char *)couleur3+'0',LEFT_MODE);*/
+                }
+                
                 break;   
-                
+                                
             case NO_BLOC: //il n'y a pas de bloc, on saute les étapes liées à l'attrape bloc
                 actual_instruction = instruction.nextLineError;
                 gameEtat = ETAT_GAME_LOAD_NEXT_INSTRUCTION;