PushToGo on STM32F429-Disco Board

Dependencies:   BSP_DISCO_F429ZI LCD_DISCO_F429ZI pushtogo usb

Revision:
1:64c1fd738059
Parent:
0:084d1dae2ea1
Child:
5:5ea2862a3493
--- a/LCDConsole.cpp	Sun Aug 19 05:20:21 2018 +0000
+++ b/LCDConsole.cpp	Sun Sep 09 19:03:27 2018 +0000
@@ -1,13 +1,14 @@
 /*
  * LCDStreamHandle.cpp
  *
- *  Created on: 2018Äê2ÔÂ25ÈÕ
+ *  Created on: 2018��2��25��
  *      Author: caoyuan9642
  */
 
-#include "LCDConsole.h"
 #include <math.h>
 #include <ctype.h>
+#include <time.h>
+#include "LCDConsole.h"
 #include "MCULoadMeasurement.h"
 
 bool LCDConsole::inited = false;
@@ -92,9 +93,12 @@
 			MCULoadMeasurement::getInstance().reset();
 
 			time_t t = time(NULL);
-			struct tm ts;
-			gmtime_r(&t, &ts);
+			
+			core_util_critical_section_enter();
+			struct tm &ts = *localtime(&t);
 			strftime(sbuf, sizeof(sbuf), "%T, %x", &ts);
+			core_util_critical_section_exit();
+			
 			strcat(sbuf, " UTC"); // append
 
 			lcd.SetBackColor(0xFF00AF7F);