Programme carte strategie (disco)

Dependencies:   mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac

Revision:
9:d0042422d95a
Parent:
8:0edc7dfb7f7e
Child:
10:a788d9cf60f2
diff -r 0edc7dfb7f7e -r d0042422d95a Strategie/Strategie.cpp
--- a/Strategie/Strategie.cpp	Wed Apr 27 13:05:03 2016 +0000
+++ b/Strategie/Strategie.cpp	Thu Apr 28 08:11:36 2016 +0000
@@ -204,6 +204,12 @@
             SendRawId(ECRAN_ACK_START_MATCH);
             tactile_printf("Attente du JACK.");
             jack.fall(&jack_ISR); // création de l'interrupt attachée au changement d'état (front descendant) sur le jack
+            
+#ifdef ROBOT_BIG
+            SetOdometrie(ODOMETRIE_BIG_POSITION, POSITION_DEBUT_X,POSITION_DEBUT_Y,POSITION_DEBUT_T);
+#else
+            SetOdometrie(ODOMETRIE_SMALL_POSITION, POSITION_DEBUT_X,POSITION_DEBUT_Y,POSITION_DEBUT_T);
+#endif
         break;
         case ETAT_GAME_WAIT_FOR_JACK:
             //TODO Attendre le jack
@@ -255,7 +261,7 @@
                     }
                     
                     localData1 = ((instruction.direction == FORWARD)?1:-1);
-                    BendRadius (instruction.arg1, instruction.arg3, localData1, localData5);
+                    BendRadius(instruction.arg1, instruction.arg3, localData1, localData5);
                 break;
                 case MV_LINE:
                     waitingAckID = ASSERVISSEMENT_RECALAGE;
@@ -388,8 +394,8 @@
                             waitingAckFrom = INSTRUCTION_END_MOTEUR;
                         break;
                         case ACTION:
-                            waitingAckFrom = SERVO_AX12_DONE;
-                            waitingAckID = instruction.arg1;
+                            waitingAckFrom = 0;//SERVO_AX12_DONE;
+                            waitingAckID = 0;//instruction.arg1;
                         break;
                         default:
                         break;
@@ -517,17 +523,17 @@
                 }
             break;
             case SERVO_AX12_SETGOAL:
-                SendAck(0x114, SERVO_AX12_SETGOAL);
+                //SendAck(0x114, SERVO_AX12_SETGOAL);
                 if(AX12_isLocal(msgRxBuffer[FIFO_lecture].data[0]))
                     AX12_setGoal(msgRxBuffer[FIFO_lecture].data[0], msgRxBuffer[FIFO_lecture].data[1]|((unsigned short)(msgRxBuffer[FIFO_lecture].data[2])<<8), msgRxBuffer[FIFO_lecture].data[3]|((unsigned short)(msgRxBuffer[FIFO_lecture].data[4])<<8));
                   
             break;
             case SERVO_AX12_PROCESS:
-                SendAck(0x114, SERVO_AX12_PROCESS);
+                //SendAck(0x114, SERVO_AX12_PROCESS);
                 AX12_processChange(1);
             break;
             case SERVO_AX12_DONE:
-                SendAck(0x114, SERVO_AX12_DONE);
+                //SendAck(0x114, SERVO_AX12_DONE);
                 AX12_notifyCANEnd(((unsigned short)(msgRxBuffer[FIFO_lecture].data[0])));
             break;
             case ECRAN_CHOICE_COLOR://Choix de la couleur
@@ -544,6 +550,7 @@
                     // couleur sur 1 octet
                     msgTx.data[0]=msgRxBuffer[FIFO_lecture].data[0];
                     can1.write(msgTx);
+                    
                 }
             break;
             case ECRAN_CHOICE_STRAT://Choix du fichier de stratégie à utiliser
@@ -560,6 +567,8 @@
                         msgTx.data[0]=0;
                     }
                     can1.write(msgTx);
+                    wait_ms(10);
+                    tactile_printf("Strat %d selectionne",msgTx.data[0]);
                 }
             break;
             case BALISE_STOP: