Projet_S5 / Mbed 2 deprecated Repo_Noeud_Mobile_refactor

Dependencies:   mbed-rtos mbed

Fork of Repo_Noeud_Mobile by Projet_S5

Revision:
33:ab4ff35d27ea
Parent:
29:9a932d354ae3
Child:
34:ac7c8d759009
--- a/main.cpp	Mon Apr 06 18:32:34 2015 +0000
+++ b/main.cpp	Mon Apr 06 19:12:52 2015 +0000
@@ -54,7 +54,7 @@
 Thread* flex_thread_ptr = NULL;         // Lecture des entrées analogiques
 
 Mail<flex_t, 32> mailbox_flex;
-
+Mail<Mobile_Vers_Fixe, 32> mailbox_Mobile_Vers_Fixe;
 
 extern "C" void TIMER2_IRQHandler(void)
 {
@@ -132,9 +132,13 @@
     while(true) {
         Thread::signal_wait(0x02);
         flex_data = flexSensors.get_flex_values();
-        flex_t *mail = mailbox_flex.alloc();
-        mail = &flex_data;
-        mailbox_flex.put(mail);
+        Mobile_Vers_Fixe *mail = mailbox_Mobile_Vers_Fixe.alloc();
+        mail->flexSensor = flex_data;
+        mail->gants = 0x01;
+        mail->accelData.x = 0x00;
+        mail->accelData.y = 0x00;
+        mail->accelData.z = 0x01;
+        mailbox_Mobile_Vers_Fixe.put(mail);
     }
 }
 
@@ -157,9 +161,13 @@
             windup = 0;
             Thread::wait(500);
             flex_data = flexSensors.get_flex_values();
-            flex_t *mail = mailbox_flex.alloc();
-            mail = &flex_data;
-            mailbox_flex.put(mail);
+            Mobile_Vers_Fixe *mail = mailbox_Mobile_Vers_Fixe.alloc();
+            mail->flexSensor = flex_data;
+            mail->gants = 0x01;
+            mail->accelData.x = 0x01;
+            mail->accelData.y = 0x00;
+            mail->accelData.z = 0x00;
+            mailbox_Mobile_Vers_Fixe.put(mail);
             // send data frame to the fixed mbed for analyze
         }
         accel.clear_TRANSIENT_INTERRUPT();