APP4

Dependencies:   mbed-rtos mbed

Fork of rtos_basic by mbed official

Revision:
21:846e642eb63e
Parent:
20:b45474290281
Child:
22:e73831429e1c
--- a/main.cpp	Tue Oct 23 16:26:07 2018 +0000
+++ b/main.cpp	Tue Oct 23 18:08:32 2018 +0000
@@ -25,7 +25,7 @@
 Mail<message_t,128> mail_box;
 Timer timer;
 int etat;
-const int longMessage = 64;
+const int longMessage = 65;
 bool messageUtile[longMessage] = {0,0,1,0,1,1,1,0,
                         1,0,1,0,0,0,0,0,
                         0,0,1,1,1,0,1,0,
@@ -33,7 +33,7 @@
                         0,1,0,1,1,0,1,1,
                         1,0,1,0,1,1,1,0,
                         0,0,1,0,1,0,0,0,
-                        1,0,1,0,1,1,0,0};
+                        1,1,0,1,0,1,1,0,0};
 
 //CRC16 (détection des erreurs) ----------------------------------------------------------------------------------------------------
 unsigned short crc16(bool* data_p, int length){
@@ -187,7 +187,7 @@
     bool start[8];
     bool flag[8];
     bool longueur[8];
-    bool message[64];
+    bool message[80*8];
     bool checksum[8];
     bool end[8];
     int longInt;
@@ -349,7 +349,7 @@
         
         else if((compteur == 40 +longInt) && (etat ==7)) {
             etat =8;
-            unsigned short crc = crc16(message, (int)sizeof(message));
+            unsigned short crc = crc16(message, longInt);
             printf("\r\n -----------------CRC RECALCULE: %d-------------\r\n", crc);
             int_to_bin2(bin2, crc);
             for(int i=0; i<8;i++){