yes Spada / Mbed OS programme
Revision:
23:f45027ac625c
Parent:
18:7002e66af2e5
Child:
24:6f7c34f9d0f8
diff -r 79c64511d34d -r f45027ac625c MeasurementHistory.h
--- a/MeasurementHistory.h	Wed May 29 06:36:54 2019 +0000
+++ b/MeasurementHistory.h	Wed May 29 06:50:47 2019 +0000
@@ -10,8 +10,8 @@
   
   //    Add some new values to the history
   void addMeasurement(uint32_t pressure, int16_t temp, uint16_t humidity, uint32_t time);
-  
-  uint32_t getPressureTrend();
+
+  uint8_t getPressureTrend( uint32_t newPressure);
     
 private:
 
@@ -22,7 +22,19 @@
     uint32_t time;
     //  Size: 96 bits, 12 Bytes
   };
-  
+    // Enum for pressure trend
+  enum pressureTrendStates {
+    UNKNOWN                 = 0,
+    FALLING_CONTINUOUSLY    = 1,
+    RISING_CONTINUOUSLY     = 2,
+    FALLING_STEADY          = 3,
+    RISING_STEADY           = 4,
+    FALLING_LESSER_RISE     = 5,
+    FALLING_GREATER_RISE    = 6,
+    RISING_GREATER_RISE     = 7,
+    RISING_LESSER_RISE      = 8,
+    STEADY                  = 9
+  };
   //    Counting the array's dimension according to max size
   static const int DEFAULT_SIZE = 2048;
   static const int ARRAY_SIZE = DEFAULT_SIZE/sizeof(Data);