diff --git a/components/dwin/dwin.hpp b/components/dwin/dwin.hpp index b12abae..4826070 100644 --- a/components/dwin/dwin.hpp +++ b/components/dwin/dwin.hpp @@ -6,9 +6,10 @@ namespace iflytop { namespace dwin { typedef enum { - kdwin_color_green = 0x1694, // kgreen - kdwin_color_red = 0xF800, // kred - kdwin_color_blue = 0x12DC, // kblue + kdwin_color_green = 0x1694, // kgreen + kdwin_color_red = 0xF800, // kred + kdwin_color_orange = 0xFC60, // orange + kdwin_color_blue = 0x12DC, // kblue } dwin_color_t; #define kblue kdwin_color_blue diff --git a/components/dwin/var_icon.cpp b/components/dwin/var_icon.cpp index f213c69..ea0cb37 100644 --- a/components/dwin/var_icon.cpp +++ b/components/dwin/var_icon.cpp @@ -69,8 +69,6 @@ void VarIcon::setpos(uint16_t posx, uint16_t posy) { flushcfg(); } - - void VarIcon::dumpinfo() { readcfg(); printf("m_VP = %04x\n", m_descript.m_VP); @@ -95,7 +93,7 @@ bool VarIcon::setVal(uint16_t val) { } uint16_t VarIcon::getVal() { uint16_t val = 0xffff; - if(m_hide) return m_val; + if (m_hide) return m_val; m_dwin_screen->read_varspace16(m_descript.m_VP, val, 100); return val; } @@ -107,9 +105,13 @@ void VarIcon::hide() { // */ m_hide = true; }; -void VarIcon::show() { - m_hide = false; - _setVal(m_val); +void VarIcon::show(bool showval) { + if (showval) { + m_hide = false; + _setVal(m_val); + } else { + hide(); + } } VarIconDescript_t &VarIcon::getDescript() { return m_descript; } diff --git a/components/dwin/var_icon.hpp b/components/dwin/var_icon.hpp index ee159ac..79f9827 100644 --- a/components/dwin/var_icon.hpp +++ b/components/dwin/var_icon.hpp @@ -75,7 +75,7 @@ class VarIcon { uint16_t getVal(); void hide(); - void show(); + void show(bool showval = true); VarIconDescript_t &getDescript();