carte_strategie_2019

Dependencies:   mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac

Revision:
1:116040d14164
Parent:
0:ad97421fb1fb
Child:
4:88431b537477
diff -r ad97421fb1fb -r 116040d14164 Instruction/Instruction.cpp
--- a/Instruction/Instruction.cpp	Wed Apr 13 22:04:54 2016 +0000
+++ b/Instruction/Instruction.cpp	Fri Apr 15 10:49:40 2016 +0000
@@ -75,14 +75,14 @@
     char instructionPrecision;
     char instructionNextActionType;
     char instructionJumpAction;
-    
+    int errorCode = 0;
     /*
     Info sur la fonction sscanf
     %d -> Entier signé
     %u -> Entié non signé
     %c -> char
     */
-    sscanf(line, "%d,%c,%c,%u,%u,%d,%c,%c,%c,%u,%u,%d,%d",
+    errorCode = sscanf(line, "%d,%c,%c,%u,%u,%d,%c,%c,%c,%u,%u,%d,%d",
         &instruction.lineNumber,
         &instructionOrder,
         &instructionDirection,
@@ -97,6 +97,10 @@
         &instruction.nextLineOK,
         &instruction.nextLineError
     );
+    /*
+    if(errorCode != 13) {
+        errorInstructionLoop();//L'instruction est pas bonne !!  
+    }*/
     
     instruction.order           = charToInstructionType(instructionOrder);
     instruction.direction       = charToInstructionDirection(instructionDirection);
@@ -121,6 +125,9 @@
     while (fgets(LineBuffer, SIZE, testFile) != NULL)  {
         instruction = stringToInstruction(LineBuffer);
         strat_instructions[nb_instructions] = instruction;
+        if(strat_instructions[nb_instructions].order == UNKNOWN) {
+            errorInstructionLoop();//L'instruction est pas bonne !!   
+        }
         //printf(LineBuffer);
         //debug_Instruction(instruction);
         nb_instructions++;