From 8251cf7dbb0be9b9e12d9c8afa2677315b777b4b Mon Sep 17 00:00:00 2001
From: Erwin Ried <1091420+eried@users.noreply.github.com>
Date: Sat, 15 Aug 2020 15:46:53 +0200
Subject: [PATCH] Hide the seconds at the beginning

---
 firmware/common/ui_widget.cpp | 14 ++++++++++++--
 firmware/common/ui_widget.hpp |  1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/firmware/common/ui_widget.cpp b/firmware/common/ui_widget.cpp
index 1372410d..43669923 100644
--- a/firmware/common/ui_widget.cpp
+++ b/firmware/common/ui_widget.cpp
@@ -418,7 +418,16 @@ void LiveDateTime::on_tick_second() {
 	text = text + to_string_dec_uint(datetime.hour(), 2, '0') + ":" + to_string_dec_uint(datetime.minute(), 2, '0');
 
 	if(seconds_enabled){
-		text = text + ":" + to_string_dec_uint(datetime.second(), 2, '0');
+		text += ":";
+
+		if(init_delay==0)
+			text += to_string_dec_uint(datetime.second(), 2, '0');
+		else
+		{
+			// Placeholder while the seconds are not updated
+			text += "XX";
+			init_delay--;
+		}
 	}
 	set_dirty();
 }
@@ -640,7 +649,8 @@ void Console::write(std::string message) {
 
 void Console::writeln(std::string message) {
 	write(message);
-	crlf();
+	//crlf();
+	write("\n");
 }
 
 void Console::paint(Painter&) {
diff --git a/firmware/common/ui_widget.hpp b/firmware/common/ui_widget.hpp
index 5b592c48..51de4277 100644
--- a/firmware/common/ui_widget.hpp
+++ b/firmware/common/ui_widget.hpp
@@ -254,6 +254,7 @@ public:
 private:
 	void on_tick_second();
 	
+	uint16_t init_delay = 4;
 	bool date_enabled = true;
 	bool seconds_enabled = false;
 	
-- 
GitLab