Nelson Santos / Mbed 2 deprecated trabalho

Dependencies:   X_NUCLEO_IKS01A1-f255a2c75ecb mbed-rtos mbed

Revision:
23:36a76a98c438
Parent:
21:849e5636076e
Parent:
22:23d5bb18d6a0
--- a/sensor.cpp	Tue May 17 21:19:57 2016 +0000
+++ b/sensor.cpp	Tue May 17 21:23:48 2016 +0000
@@ -10,13 +10,23 @@
 bool ExpansionBoard::flag;
 
 //This is the producer
+<<<<<<< local
 void ExpansionBoard::sampleData()
 {
     if(flag) {
         printf("\nAbout to alloc\n");
     }
+=======
+void ExpansionBoard::sampleData() {
+  
+    printf("\nAbout to alloc\n");
+>>>>>>> other
     log_data* log_d = (log_data*)mail_box.alloc();
+<<<<<<< local
 
+=======
+          printf("Pressure: %f",log_d->pressure);
+>>>>>>> other
     if (log_d == NULL) {
         mail_box.get();
         if(flag) {
@@ -45,10 +55,17 @@
     }
     //Send pointer to sample to the queue
     osStatus stat = mail_box.put(log_d);
+<<<<<<< local
 
     if(flag) {
         printf("MAIL_BOX.PUT run\n");
     }
+=======
+    osEvent ev = mail_box.get();
+    log_data *ld = (log_data*)ev.value.p;
+    printf("Pressure: %f",ld->pressure);
+    printf("MAIL_BOX.PUT run\n");
+>>>>>>> other
     // Check for resource error
     if (stat == osErrorResource) {
         if(flag) {
@@ -56,6 +73,7 @@
         }
         //Error, free up memory block taken
         mail_box.free(log_d);
+    
     }
 }
 
@@ -73,10 +91,16 @@
             // Successful, store log_data
             log_data* temp = (log_data*) event.value.p;
             v->push_back(*temp);
+<<<<<<< local
             mail_box.free(temp);
             if(flag) {
                 printf("GET value stored and freed up mail_box\n");
             }
+=======
+            //mail_box.free(temp);
+            printf("gotcha: %f",temp->pressure);
+            printf("GET value stored and freed up mail_box\n");
+>>>>>>> other
         }
     }
 }