Projet_S5 / Mbed 2 deprecated Repo_Noeud_Mobile_refactor

Dependencies:   mbed-rtos mbed

Fork of Repo_Noeud_Mobile by Projet_S5

Revision:
34:ac7c8d759009
Parent:
33:ab4ff35d27ea
Parent:
32:7bdaac2c4cbf
Child:
35:02c1049699aa
--- a/main.cpp	Mon Apr 06 19:12:52 2015 +0000
+++ b/main.cpp	Mon Apr 06 19:14:44 2015 +0000
@@ -68,11 +68,11 @@
 
 int main(void const* args)
 {
-    m_pc.printf("==== PROGRAM START MOBILE ====\r\n");
+    m_pc.printf("\r\n==== PROGRAM START MOBILE ====\r\n");
     // Initializing the accelerometer
 
     ReadConfig(); //read config file
-    m_pc.printf("PANID %#04x\r\n", PanId);
+    m_pc.printf("PANID %x\r\n", PanId);
     xbee = new Xbee(PanId, p13, p14); //set PAN ID
 
 #if ACTIVATE_ACCEL
@@ -104,7 +104,17 @@
 
     rps_read = new Thread(flex_read);
 
+    #if ACTIVATE_ACCEL
+        Thread thread0(reception_coord);
+        Thread thread1(etat_de_jeu);
+        Thread thread2(analyze_sensor_data);
+        threads[0] = &thread0;
+        threads[1] = &thread1;
+        threads[2] = &thread2;
+    #endif
+    
     while(true) {
+        
     }
 }
 
@@ -207,7 +217,6 @@
 {
 }
 
-
 //read config file
 void ReadConfig()
 {
@@ -216,15 +225,15 @@
         char buffer[2];
         //char time;
         //char selector;
-
+ 
         fscanf(file, "%x", &buffer); //panID = 2 char
         //fscanf(file, "%d", &time); //read period = 1 decimal
         //fscanf(file, "%d", &selector); //end device selector = 1 decimal
-
+ 
         PanId = buffer[1] << 8 | buffer[0]; //set PAN ID global variable
         //ReadPeriod = time; //set read period global variable
         //EndDeviceSelection = selector; //set end device selection global variable
-
+ 
         fclose(file); //close file
     } else { //if file is not found
         m_pc.printf("ERROR AT CONFIG FILE \r\n");