Projet_S5 / Mbed 2 deprecated Repo_Noeud_Mobile_refactor

Dependencies:   mbed-rtos mbed

Fork of Repo_Noeud_Mobile by Projet_S5

Revision:
32:7bdaac2c4cbf
Parent:
29:9a932d354ae3
Parent:
30:389d09853cd1
Child:
34:ac7c8d759009
Child:
36:e587950c288c
--- a/main.cpp	Mon Apr 06 18:45:06 2015 +0000
+++ b/main.cpp	Mon Apr 06 18:53:34 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) {
+        
     }
 }
 
@@ -199,7 +209,6 @@
 {
 }
 
-
 //read config file
 void ReadConfig()
 {
@@ -208,15 +217,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");