Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
101:8a25782572a3
Parent:
99:55317f374a94
Child:
103:109fba818301
diff -r dcaf26e93bae -r 8a25782572a3 src/main.cpp
--- a/src/main.cpp	Wed Sep 21 20:33:22 2016 +0000
+++ b/src/main.cpp	Wed Sep 21 20:56:26 2016 +0000
@@ -62,9 +62,13 @@
  *****************************************************************************/
 static void banner( void )
 {
-    //int iyr=0, imo=0, idy=0, ihr=0, imn=0, isc=0;
+    struct tm       *ts;
+    time_t curr_sec;
+    char time_string[80];
 
-    //rtc_get_time(&iyr, &imo, &idy, &ihr, &imn, &isc);
+    curr_sec = time(0);
+    ts = localtime(&curr_sec);
+    strftime(time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", ts);
 
     printf("\n\n\r\nWelcome to Project: ICE v0.0.69\n");
     printf("\rThe Intelligent Connected Experience\n");
@@ -77,7 +81,7 @@
     printf("\r\t  _| |_  | |____  | |____ \n");
     printf("\r\t |_____|  \\_____| |______|\n");
 
-    //printf("\r\nCurrent time is: %04d-%02d-%02d %02d:%02d:%02d\r\n", iyr, imo, idy, ihr, imn, isc);
+    printf("\r\nCurrent time is: %s\r\n", time_string);
 
     printf("\r\n\r\n\r\n");
     printf("\rMultiTech mDot library version: %s\n", GLOBAL_mdot->getId().c_str());
@@ -94,9 +98,9 @@
 int main( void )
 {
     mDot *dot;
-    //struct tm rtc_time;
-    //time_t curr_sec;
-    //int year=0;
+    struct tm rtc_time;
+    time_t curr_sec;
+    int year=0;
 
     // singleton object instatiation
     GLOBAL_mdot = dot = mDot::getInstance();
@@ -104,14 +108,14 @@
 
     i2c = &i2c_instance;
 
-    //rtc_init();
-#if 0
+    rtc_init();
+
     rtc_get_time(&year, &rtc_time.tm_mon, &rtc_time.tm_mday, &rtc_time.tm_hour, &rtc_time.tm_min, &rtc_time.tm_sec);
     rtc_time.tm_mon = rtc_time.tm_mon - 1;
     rtc_time.tm_year = year - 1900;
     curr_sec =  mktime( &rtc_time );
-#endif
-    set_time(0);
+
+    set_time(curr_sec);
 
     // for signaling from the configuration handler
     mainThreadId = osThreadGetId();