3rd Repo, trying to figure this out.

Dependencies:   LPS25H hts221

Fork of SOFT253_Template_Weather_OS_54 by Stage-1 Students SoCEM

Revision:
46:0de1f3c7d118
Parent:
45:9a33f2bc2b4e
Child:
47:468a89d62c23
--- a/main.cpp	Thu Apr 06 14:11:37 2017 +0000
+++ b/main.cpp	Thu Apr 06 15:31:01 2017 +0000
@@ -12,7 +12,6 @@
 #define SIGNAL_doMeasure 1
 #define SWITCH1_RELEASE 90
  
-void thread1();
  
 DigitalOut myled(LED1);
 I2C i2c2(I2C_SDA, I2C_SCL);
@@ -31,8 +30,12 @@
 Mail<Measure, 16> mail_box;
  
 LinkedList *listBuffer;
- 
-// Call this on precise intervals
+LocalDate *localDate;
+void RealTimeDate()
+{
+    localDate->TickSecond();
+   
+}
 void MeasureThread() {
 
     while(true)
@@ -175,7 +178,8 @@
                 }
                 else if (CompareCommands(charPos,"status",6) == 1)
                 {
-                    printf("\r\n STATUS: \r\n # of measures: %i \r\n SAMPLING: ON \r\n Current Date: \r\n Current Time: \r\n", listBuffer->GetSize());   
+                    char *ptr = localDate->ToString();
+                    printf("\r\n STATUS: \r\n # of measures: %i \r\n SAMPLING: ON \r\n Current Date: %s \r\n", listBuffer->GetSize(),ptr);   
                 }
               //  printf("%s \r\n", charPos);
               //  charPos = strtok(NULL," -,");
@@ -205,13 +209,15 @@
     measurer.init();
     measurer.calib();
     listBuffer = new LinkedList();
-    
+    localDate = new LocalDate();
     //Start message
     printf("Welcome\r\n");           
    
     //Hook up timer interrupt   
     Ticker timer; 
     timer.attach(&SendSignalDoMeasure, 2.0);
+    Ticker realTimeDate;
+    realTimeDate.attach(&RealTimeDate,1.0);
                
     //Threads
     produceThread = new Thread();