Add support for dimmed flag display draft

Tue, 10 Nov 2020 22:22:16 +0100

author
David Douard <david.douard@sdf3.org>
date
Tue, 10 Nov 2020 22:22:16 +0100
changeset 51
d8042bff0e00
parent 50
279868684eb3
child 52
098124b730eb

Add support for dimmed flag display

src/display.cpp file | annotate | diff | comparison | revisions
src/display.h file | annotate | diff | comparison | revisions
--- a/src/display.cpp	Tue Nov 10 22:21:35 2020 +0100
+++ b/src/display.cpp	Tue Nov 10 22:22:16 2020 +0100
@@ -234,11 +234,14 @@
 }
 
 
-void Display::set_flag(uint8_t flag, bool show=true)
+void Display::set_flag(uint8_t flag, bool show, bool dimm)
 {
 	uint8_t i;
 	uint8_t bgcolor = 0x00, fgcolor = 0xFF;
 
+	if (dimm)
+		fgcolor /= 2;
+
 	for (uint8_t l=0; l<(sizeof(flags)/sizeof(flags[0])); ++l)
 	{
 		if (flag == flags[l].flag)
--- a/src/display.h	Tue Nov 10 22:21:35 2020 +0100
+++ b/src/display.h	Tue Nov 10 22:22:16 2020 +0100
@@ -168,7 +168,7 @@
 	void dimm_char(uint8_t);
 	void show_splashscreen();
 	void show_byescreen();
-	void set_flag(uint8_t flag, bool show);
+	void set_flag(uint8_t flag, bool show=true, bool dimm=false);
 	void show_flag(uint8_t flag) {set_flag(flag, true);};
 	void hide_flag(uint8_t flag) {set_flag(flag, false);};
 	void shift_on() {set_flag(0x80, true);};

mercurial