team app1 / Mbed 2 deprecated app2

Dependencies:   mbed mbed-rtos

Revision:
6:a16c0a024fd5
Parent:
5:85cbea9f3eb7
diff -r 85cbea9f3eb7 -r a16c0a024fd5 main.cpp
--- a/main.cpp	Tue Sep 19 16:59:01 2017 +0000
+++ b/main.cpp	Tue Sep 19 17:55:20 2017 +0000
@@ -44,6 +44,7 @@
 
 // Pour le time stamp
 char buffer[32];
+struct tm * timeinfo;
 
 // structure de data
 typedef struct {
@@ -194,19 +195,23 @@
             // retrive information from queue to data structure
             data *dataDisplay = (data*)evt.value.p;
             
-            printf("Pin numero = %d\n\r", dataDisplay->pinNumero);
+            printf("Pin numero = %d \t", dataDisplay->pinNumero);
             // conversion des secondes en format AA:MM:JJ:HH:MM:SS
-            strftime(buffer, 32, "%y:%m:%d:%H:%M:%S \n\r", localtime(&dataDisplay->seconds));
-            printf("Time as a custom formatted string = %s\n\r", buffer);
+            timeinfo = localtime(&dataDisplay->seconds);
+            
+            //strftime(buffer, 32, "%y:%m:%d:%H:%M:%S \n\r", localtime(&dataDisplay->seconds));
+            //printf("Time as a custom formatted string = %s\n\r", buffer);
+            
+            printf ("Current local time and date: %d:%.2d:%.2d:%.2d:%.2d:%.2d \t", (1900 + timeinfo->tm_year),(timeinfo->tm_mon + 1), (timeinfo->tm_mday), timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
             
             if(dataDisplay->type == POTENTIOMETRE)
             {
-                printf("Moyenne courante = %d\n\r", dataDisplay->info);
+                printf("Moyenne courante = %d \t\n\r", dataDisplay->info);
             }
             
             if(dataDisplay->type == BOUTON)
             {
-                printf("etat = %d\n\r", dataDisplay->info);
+                printf("etat = %d \t\n\r", dataDisplay->info);
             }
             
             mpool.free(dataDisplay);    // free memory pool
@@ -232,7 +237,7 @@
 }
 
 int main() {
-    set_time(1505568984);  // Set RTC time to today
+    set_time(1505829060);  // Set RTC time to today
     
     Thread thread1;     //Create thread 1, READY state 
     threadNumerique = &thread1;