trabalho

Dependencies:   X_NUCLEO_IKS01A1 mbed-rtos mbed

Fork of HelloWorld_IKS01A1 by ST

Files at this revision

API Documentation at this revision

Comitter:
nlsantos
Date:
Thu May 05 15:22:13 2016 +0000
Parent:
12:7ef8061de189
Child:
14:9542d3b656ff
Commit message:
Done some changes on the data structure

Changed in this revision

logData.cpp Show annotated file Show diff for this revision Revisions of this file
mailBox.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
--- a/logData.cpp	Wed May 04 19:31:08 2016 +0000
+++ b/logData.cpp	Thu May 05 15:22:13 2016 +0000
@@ -2,7 +2,7 @@
 #include "mbed.h"
 #include "rtos.h"
 
-
+// Considering removing this class Too hard working with it; prefer data_structure found on mailbonx.cpp
 class LogData 
 {
 
--- a/mailBox.cpp	Wed May 04 19:31:08 2016 +0000
+++ b/mailBox.cpp	Thu May 05 15:22:13 2016 +0000
@@ -2,23 +2,30 @@
 #include "rtos.h"
 #include <logData.cpp>
  
-/* Mail 
-typedef struct {
-  float    voltage; 
-  float    current;  
-  uint32_t counter; 
-} mail_t;
+ typedef struct {
+  uint8_t   id;
+  float    tempCelcius;
+  float    tempFarenheit;
+  float    humidity;
+  float    pressure;
+  int      accelerometer;
+  int      gyroscope;
+  int      magnetometer;
+  int      dd;
+  int      mm;
+  int      yyyy;
+  int      hh;
+  int      min;
+  int      ss;
+  
+  }log_data;
 
-*/
-
-//LogData mail_t
- 
-Mail<LogData, 16> mail_box;
+Mail<log_data, 120> mail_box;
  
 void send_thread (void const *args) {
     while (true) {     
-        LogData *log = mail_box.alloc();
-        log->id = ;
+        log_data *log = mail_box.alloc();
+        log->id; ;
         log->tempCelcius;
         log->tempFarenheit;
         log->humidity;
@@ -38,18 +45,3 @@
     }
 }
  
-int main (void) {
-    Thread thread(send_thread);
-    
-    while (true) {
-        osEvent evt = mail_box.get();
-        if (evt.status == osEventMail) {
-            mail_t *mail = (mail_t*)evt.value.p;
-            printf("\nVoltage: %.2f V\n\r"   , mail->voltage);
-            printf("Current: %.2f A\n\r"     , mail->current);
-            printf("Number of cycles: %u\n\r", mail->counter);
-            
-            mail_box.free(mail);
-        }
-    }
-}
\ No newline at end of file
--- a/main.cpp	Wed May 04 19:31:08 2016 +0000
+++ b/main.cpp	Thu May 05 15:22:13 2016 +0000
@@ -1,9 +1,9 @@
 /**
  ******************************************************************************
  * @file    main.cpp
- * @author  AST / EST
+ * @author  ANG Group (Nelson Santos; Irina Baptista; Pierluigi Urro) 
  * @version V0.0.1
- * @date    14-August-2015
+ * @date    05-May-2016
  * @brief   Simple Example application for using the X_NUCLEO_IKS01A1 
  *          MEMS Inertial & Environmental Sensor Nucleo expansion board.
  ******************************************************************************
--- a/mbed-rtos.lib	Wed May 04 19:31:08 2016 +0000
+++ b/mbed-rtos.lib	Thu May 05 15:22:13 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#bdd541595fc5
+http://mbed.org/users/mbed_official/code/mbed-rtos/#162b12aea5f2