From 04dd43f15971caef896308110a6f27bc711cad06 Mon Sep 17 00:00:00 2001 From: e2002 Date: Thu, 2 Mar 2023 11:51:58 +0300 Subject: [PATCH] v0.8.988 --- yoRadio/fonts/glcdfont.c | 36 +++++++++---------- yoRadio/src/core/display.cpp | 11 +++--- yoRadio/src/core/options.h | 5 ++- .../src/displays/conf/displayGC9A01Aconf.h | 2 +- .../src/displays/conf/displayILI9341conf.h | 2 +- .../src/displays/conf/displayILI9488conf.h | 4 +-- yoRadio/src/displays/conf/displayST7789conf.h | 2 +- yoRadio/src/displays/conf/displayST7796conf.h | 4 +-- 8 files changed, 35 insertions(+), 31 deletions(-) diff --git a/yoRadio/fonts/glcdfont.c b/yoRadio/fonts/glcdfont.c index cec242f..13c52fd 100644 --- a/yoRadio/fonts/glcdfont.c +++ b/yoRadio/fonts/glcdfont.c @@ -14,35 +14,35 @@ static const unsigned char font[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, -0x20, 0x20, 0x00, 0x10, 0x10, -0x08, 0x08, 0x00, 0x04, 0x04, -0x60, 0x60, 0x00, 0x10, 0x10, -0x60, 0x60, 0x00, 0x70, 0x70, -0x78, 0x78, 0x00, 0x04, 0x04, -0x78, 0x78, 0x00, 0x7C, 0x7C, -0x00, 0x1C, 0x1C, 0x1C, 0x00, -0x7A, 0x00, 0x7E, 0x12, 0x1E, //<<-- -0x06, 0x09, 0x09, 0x06, 0x00, +0x20, 0x20, 0x00, 0x10, 0x10, // \001 rssi 00__ +0x08, 0x08, 0x00, 0x04, 0x04, // \002 rssi __00 +0x60, 0x60, 0x00, 0x10, 0x10, // \003 rssi 10__ +0x60, 0x60, 0x00, 0x70, 0x70, // \004 rssi 11__ +0x78, 0x78, 0x00, 0x04, 0x04, // \005 rssi __10 +0x78, 0x78, 0x00, 0x7C, 0x7C, // \006 rssi __11 +0x00, 0x1C, 0x1C, 0x1C, 0x00, // \007 weather div +0x7A, 0x00, 0x7E, 0x12, 0x1E, // \010 ip +0x06, 0x09, 0x09, 0x06, 0x00, // \011 degree 0x7F, 0x63, 0x6B, 0x63, 0x7F, 0x30, 0x48, 0x4D, 0x33, 0x07, 0x06, 0x29, 0x79, 0x29, 0x06, 0x20, 0x50, 0x3F, 0x02, 0x0C, -0x60, 0x7F, 0x05, 0x35, 0x3F, +0x60, 0x7F, 0x05, 0x35, 0x3F, // \016 note 0x2A, 0x1C, 0x77, 0x1C, 0x2A, -0x00, 0x7F, 0x3E, 0x1C, 0x08, -0x08, 0x1C, 0x3E, 0x7F, 0x00, +0x00, 0x7F, 0x3E, 0x1C, 0x08, // \020 next/play +0x08, 0x1C, 0x3E, 0x7F, 0x00, // \021 prev 0x14, 0x22, 0x7F, 0x22, 0x14, -0x00, 0x5F, 0x00, 0x5F, 0x00, -0x06, 0x09, 0x7F, 0x01, 0x7F, -0x4A, 0x55, 0x55, 0x55, 0x29, -0x60, 0x60, 0x60, 0x60, 0x60, +0x00, 0x00, 0x18, 0x3C, 0x7E, // \023 speaker +0x18, 0x00, 0x00, 0x00, 0x00, // \024 25% +0x18, 0x42, 0x3C, 0x00, 0x00, // \025 50% +0x18, 0x42, 0x3C, 0x42, 0x3C, // \026 100% 0x54, 0x62, 0x7F, 0x62, 0x54, 0x08, 0x04, 0x7E, 0x04, 0x08, 0x08, 0x10, 0x3F, 0x10, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x08, 0x1C, 0x2A, 0x08, 0x08, -0x1C, 0x10, 0x10, 0x10, 0x10, -0x1C, 0x3E, 0x08, 0x3E, 0x1C, +0x7F, 0x7F, 0x00, 0x7F, 0x7F, // \034 pause +0x55, 0x00, 0x55, 0x55, 0x55, // \035 list 0x30, 0x3C, 0x3F, 0x3C, 0x30, 0x06, 0x1E, 0x7E, 0x1E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/yoRadio/src/core/display.cpp b/yoRadio/src/core/display.cpp index 14f14b8..713e19c 100644 --- a/yoRadio/src/core/display.cpp +++ b/yoRadio/src/core/display.cpp @@ -425,11 +425,12 @@ void Display::_setRSSI(int rssi) { return; #endif char rssiG[3]; - if(rssi >= -50) strlcpy(rssiG, "\004\006", 3); - if(rssi >= -60 && rssi < -50) strlcpy(rssiG, "\004\005", 3); - if(rssi >= -70 && rssi < -60) strlcpy(rssiG, "\004\002", 3); - if(rssi >= -80 && rssi < -70) strlcpy(rssiG, "\003\002", 3); - if(rssi < -80 || rssi >= 0) strlcpy(rssiG, "\001\002", 3); + int rssi_steps[] = {RSSI_STEPS}; + if(rssi >= rssi_steps[0]) strlcpy(rssiG, "\004\006", 3); + if(rssi >= rssi_steps[1] && rssi < rssi_steps[0]) strlcpy(rssiG, "\004\005", 3); + if(rssi >= rssi_steps[2] && rssi < rssi_steps[1]) strlcpy(rssiG, "\004\002", 3); + if(rssi >= rssi_steps[3] && rssi < rssi_steps[2]) strlcpy(rssiG, "\003\002", 3); + if(rssi < rssi_steps[3] || rssi >= 0) strlcpy(rssiG, "\001\002", 3); _rssi->setText(rssiG); } diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index 1e8b531..a691589 100644 --- a/yoRadio/src/core/options.h +++ b/yoRadio/src/core/options.h @@ -1,7 +1,7 @@ #ifndef options_h #define options_h -#define YOVERSION "0.8.981" +#define YOVERSION "0.8.988" /******************************************************* DO NOT EDIT THIS FILE. @@ -291,6 +291,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti #ifndef RSSI_DIGIT #define RSSI_DIGIT false // Extended weather #endif +#ifndef RSSI_STEPS + #define RSSI_STEPS -50,-60,-70,-80 +#endif /* *** ST7735 display submodel *** INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html diff --git a/yoRadio/src/displays/conf/displayGC9A01Aconf.h b/yoRadio/src/displays/conf/displayGC9A01Aconf.h index a30e1ad..54b87c8 100644 --- a/yoRadio/src/displays/conf/displayGC9A01Aconf.h +++ b/yoRadio/src/displays/conf/displayGC9A01Aconf.h @@ -58,7 +58,7 @@ const VUBandsConfig bandsConf PROGMEM = { 90, 20, 6, 2, 10, 5 }; const char numtxtFmt[] PROGMEM = "%d"; const char rssiFmt[] PROGMEM = "WIFI %d"; const char iptxtFmt[] PROGMEM = "%s"; -const char voltxtFmt[] PROGMEM = "\016 %d"; +const char voltxtFmt[] PROGMEM = "\023\025%d"; const char bitrateFmt[] PROGMEM = "%d KBS"; /* MOVES */ /* { left, top, width } */ diff --git a/yoRadio/src/displays/conf/displayILI9341conf.h b/yoRadio/src/displays/conf/displayILI9341conf.h index 97c944e..061f22b 100644 --- a/yoRadio/src/displays/conf/displayILI9341conf.h +++ b/yoRadio/src/displays/conf/displayILI9341conf.h @@ -57,7 +57,7 @@ const VUBandsConfig bandsConf PROGMEM = { 24, 100, 4, 2, 10, 5 }; const char numtxtFmt[] PROGMEM = "%d"; const char rssiFmt[] PROGMEM = "WiFi %d"; const char iptxtFmt[] PROGMEM = "\010 %s"; -const char voltxtFmt[] PROGMEM = "\016 %d"; +const char voltxtFmt[] PROGMEM = "\023\025%d"; const char bitrateFmt[] PROGMEM = "%d kBs"; /* MOVES */ /* { left, top, width } */ diff --git a/yoRadio/src/displays/conf/displayILI9488conf.h b/yoRadio/src/displays/conf/displayILI9488conf.h index 18e9692..0cdd094 100644 --- a/yoRadio/src/displays/conf/displayILI9488conf.h +++ b/yoRadio/src/displays/conf/displayILI9488conf.h @@ -39,7 +39,7 @@ const WidgetConfig bootstrConf PROGMEM = { 0, 243, 1, WA_CENTER }; const WidgetConfig bitrateConf PROGMEM = { 6, 62, 2, WA_RIGHT }; const WidgetConfig voltxtConf PROGMEM = { 0, DSP_HEIGHT-38, 2, WA_CENTER }; const WidgetConfig iptxtConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-38, 2, WA_LEFT }; -const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-38-10, 3, WA_RIGHT }; +const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-38-6, 3, WA_RIGHT }; const WidgetConfig numConf PROGMEM = { 0, 200, 70, WA_CENTER }; const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 88, 3, WA_CENTER }; const WidgetConfig apName2Conf PROGMEM = { TFT_FRAMEWDT, 120, 3, WA_CENTER }; @@ -58,7 +58,7 @@ const VUBandsConfig bandsConf PROGMEM = { 32, 130, 4, 2, 10, 10 }; const char numtxtFmt[] PROGMEM = "%d"; const char rssiFmt[] PROGMEM = "WiFi %d"; const char iptxtFmt[] PROGMEM = "%s"; -const char voltxtFmt[] PROGMEM = "%d"; +const char voltxtFmt[] PROGMEM = "\023\025%d"; const char bitrateFmt[] PROGMEM = "%d kBs"; /* MOVES */ /* { left, top, width } */ diff --git a/yoRadio/src/displays/conf/displayST7789conf.h b/yoRadio/src/displays/conf/displayST7789conf.h index bd676b4..6facf47 100644 --- a/yoRadio/src/displays/conf/displayST7789conf.h +++ b/yoRadio/src/displays/conf/displayST7789conf.h @@ -57,7 +57,7 @@ const VUBandsConfig bandsConf PROGMEM = { 24, 100, 4, 2, 10, 4 }; const char numtxtFmt[] PROGMEM = "%d"; const char rssiFmt[] PROGMEM = "WiFi %d"; const char iptxtFmt[] PROGMEM = "\010 %s"; -const char voltxtFmt[] PROGMEM = "\016 %d"; +const char voltxtFmt[] PROGMEM = "\023\025%d"; const char bitrateFmt[] PROGMEM = "%d kBs"; /* MOVES */ /* { left, top, width } */ diff --git a/yoRadio/src/displays/conf/displayST7796conf.h b/yoRadio/src/displays/conf/displayST7796conf.h index 62f9edb..a8b7ec8 100644 --- a/yoRadio/src/displays/conf/displayST7796conf.h +++ b/yoRadio/src/displays/conf/displayST7796conf.h @@ -39,7 +39,7 @@ const WidgetConfig bootstrConf PROGMEM = { 0, 243, 1, WA_CENTER }; const WidgetConfig bitrateConf PROGMEM = { 6, 62, 2, WA_RIGHT }; const WidgetConfig voltxtConf PROGMEM = { 0, DSP_HEIGHT-38, 2, WA_CENTER }; const WidgetConfig iptxtConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-38, 2, WA_LEFT }; -const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-38-16, 4, WA_RIGHT }; +const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-38-6, 3, WA_RIGHT }; const WidgetConfig numConf PROGMEM = { 0, 200, 70, WA_CENTER }; const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 88, 3, WA_CENTER }; const WidgetConfig apName2Conf PROGMEM = { TFT_FRAMEWDT, 120, 3, WA_CENTER }; @@ -58,7 +58,7 @@ const VUBandsConfig bandsConf PROGMEM = { 32, 130, 4, 2, 10, 6 }; const char numtxtFmt[] PROGMEM = "%d"; const char rssiFmt[] PROGMEM = "WiFi %d"; const char iptxtFmt[] PROGMEM = "%s"; -const char voltxtFmt[] PROGMEM = "%d"; +const char voltxtFmt[] PROGMEM = "\023\025%d"; const char bitrateFmt[] PROGMEM = "%d kBs"; /* MOVES */ /* { left, top, width } */