This commit is contained in:
e2002
2023-03-02 11:51:58 +03:00
parent c7fcb3c3bd
commit 04dd43f159
8 changed files with 35 additions and 31 deletions

View File

@@ -14,35 +14,35 @@
static const unsigned char font[] PROGMEM = { static const unsigned char font[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x20, 0x20, 0x00, 0x10, 0x10, 0x20, 0x20, 0x00, 0x10, 0x10, // \001 rssi 00__
0x08, 0x08, 0x00, 0x04, 0x04, 0x08, 0x08, 0x00, 0x04, 0x04, // \002 rssi __00
0x60, 0x60, 0x00, 0x10, 0x10, 0x60, 0x60, 0x00, 0x10, 0x10, // \003 rssi 10__
0x60, 0x60, 0x00, 0x70, 0x70, 0x60, 0x60, 0x00, 0x70, 0x70, // \004 rssi 11__
0x78, 0x78, 0x00, 0x04, 0x04, 0x78, 0x78, 0x00, 0x04, 0x04, // \005 rssi __10
0x78, 0x78, 0x00, 0x7C, 0x7C, 0x78, 0x78, 0x00, 0x7C, 0x7C, // \006 rssi __11
0x00, 0x1C, 0x1C, 0x1C, 0x00, 0x00, 0x1C, 0x1C, 0x1C, 0x00, // \007 weather div
0x7A, 0x00, 0x7E, 0x12, 0x1E, //<<-- 0x7A, 0x00, 0x7E, 0x12, 0x1E, // \010 ip
0x06, 0x09, 0x09, 0x06, 0x00, 0x06, 0x09, 0x09, 0x06, 0x00, // \011 degree
0x7F, 0x63, 0x6B, 0x63, 0x7F, 0x7F, 0x63, 0x6B, 0x63, 0x7F,
0x30, 0x48, 0x4D, 0x33, 0x07, 0x30, 0x48, 0x4D, 0x33, 0x07,
0x06, 0x29, 0x79, 0x29, 0x06, 0x06, 0x29, 0x79, 0x29, 0x06,
0x20, 0x50, 0x3F, 0x02, 0x0C, 0x20, 0x50, 0x3F, 0x02, 0x0C,
0x60, 0x7F, 0x05, 0x35, 0x3F, 0x60, 0x7F, 0x05, 0x35, 0x3F, // \016 note
0x2A, 0x1C, 0x77, 0x1C, 0x2A, 0x2A, 0x1C, 0x77, 0x1C, 0x2A,
0x00, 0x7F, 0x3E, 0x1C, 0x08, 0x00, 0x7F, 0x3E, 0x1C, 0x08, // \020 next/play
0x08, 0x1C, 0x3E, 0x7F, 0x00, 0x08, 0x1C, 0x3E, 0x7F, 0x00, // \021 prev
0x14, 0x22, 0x7F, 0x22, 0x14, 0x14, 0x22, 0x7F, 0x22, 0x14,
0x00, 0x5F, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x7E, // \023 speaker
0x06, 0x09, 0x7F, 0x01, 0x7F, 0x18, 0x00, 0x00, 0x00, 0x00, // \024 25%
0x4A, 0x55, 0x55, 0x55, 0x29, 0x18, 0x42, 0x3C, 0x00, 0x00, // \025 50%
0x60, 0x60, 0x60, 0x60, 0x60, 0x18, 0x42, 0x3C, 0x42, 0x3C, // \026 100%
0x54, 0x62, 0x7F, 0x62, 0x54, 0x54, 0x62, 0x7F, 0x62, 0x54,
0x08, 0x04, 0x7E, 0x04, 0x08, 0x08, 0x04, 0x7E, 0x04, 0x08,
0x08, 0x10, 0x3F, 0x10, 0x08, 0x08, 0x10, 0x3F, 0x10, 0x08,
0x08, 0x08, 0x2A, 0x1C, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08,
0x08, 0x1C, 0x2A, 0x08, 0x08, 0x08, 0x1C, 0x2A, 0x08, 0x08,
0x1C, 0x10, 0x10, 0x10, 0x10, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, // \034 pause
0x1C, 0x3E, 0x08, 0x3E, 0x1C, 0x55, 0x00, 0x55, 0x55, 0x55, // \035 list
0x30, 0x3C, 0x3F, 0x3C, 0x30, 0x30, 0x3C, 0x3F, 0x3C, 0x30,
0x06, 0x1E, 0x7E, 0x1E, 0x06, 0x06, 0x1E, 0x7E, 0x1E, 0x06,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

View File

@@ -425,11 +425,12 @@ void Display::_setRSSI(int rssi) {
return; return;
#endif #endif
char rssiG[3]; char rssiG[3];
if(rssi >= -50) strlcpy(rssiG, "\004\006", 3); int rssi_steps[] = {RSSI_STEPS};
if(rssi >= -60 && rssi < -50) strlcpy(rssiG, "\004\005", 3); if(rssi >= rssi_steps[0]) strlcpy(rssiG, "\004\006", 3);
if(rssi >= -70 && rssi < -60) strlcpy(rssiG, "\004\002", 3); if(rssi >= rssi_steps[1] && rssi < rssi_steps[0]) strlcpy(rssiG, "\004\005", 3);
if(rssi >= -80 && rssi < -70) strlcpy(rssiG, "\003\002", 3); if(rssi >= rssi_steps[2] && rssi < rssi_steps[1]) strlcpy(rssiG, "\004\002", 3);
if(rssi < -80 || rssi >= 0) strlcpy(rssiG, "\001\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); _rssi->setText(rssiG);
} }

View File

@@ -1,7 +1,7 @@
#ifndef options_h #ifndef options_h
#define options_h #define options_h
#define YOVERSION "0.8.981" #define YOVERSION "0.8.988"
/******************************************************* /*******************************************************
DO NOT EDIT THIS FILE. DO NOT EDIT THIS FILE.
@@ -291,6 +291,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#ifndef RSSI_DIGIT #ifndef RSSI_DIGIT
#define RSSI_DIGIT false // Extended weather #define RSSI_DIGIT false // Extended weather
#endif #endif
#ifndef RSSI_STEPS
#define RSSI_STEPS -50,-60,-70,-80
#endif
/* /*
*** ST7735 display submodel *** *** ST7735 display submodel ***
INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html

View File

@@ -58,7 +58,7 @@ const VUBandsConfig bandsConf PROGMEM = { 90, 20, 6, 2, 10, 5 };
const char numtxtFmt[] PROGMEM = "%d"; const char numtxtFmt[] PROGMEM = "%d";
const char rssiFmt[] PROGMEM = "WIFI %d"; const char rssiFmt[] PROGMEM = "WIFI %d";
const char iptxtFmt[] PROGMEM = "%s"; const char iptxtFmt[] PROGMEM = "%s";
const char voltxtFmt[] PROGMEM = "\016 %d"; const char voltxtFmt[] PROGMEM = "\023\025%d";
const char bitrateFmt[] PROGMEM = "%d KBS"; const char bitrateFmt[] PROGMEM = "%d KBS";
/* MOVES */ /* { left, top, width } */ /* MOVES */ /* { left, top, width } */

View File

@@ -57,7 +57,7 @@ const VUBandsConfig bandsConf PROGMEM = { 24, 100, 4, 2, 10, 5 };
const char numtxtFmt[] PROGMEM = "%d"; const char numtxtFmt[] PROGMEM = "%d";
const char rssiFmt[] PROGMEM = "WiFi %d"; const char rssiFmt[] PROGMEM = "WiFi %d";
const char iptxtFmt[] PROGMEM = "\010 %s"; 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"; const char bitrateFmt[] PROGMEM = "%d kBs";
/* MOVES */ /* { left, top, width } */ /* MOVES */ /* { left, top, width } */

View File

@@ -39,7 +39,7 @@ const WidgetConfig bootstrConf PROGMEM = { 0, 243, 1, WA_CENTER };
const WidgetConfig bitrateConf PROGMEM = { 6, 62, 2, WA_RIGHT }; const WidgetConfig bitrateConf PROGMEM = { 6, 62, 2, WA_RIGHT };
const WidgetConfig voltxtConf PROGMEM = { 0, DSP_HEIGHT-38, 2, WA_CENTER }; 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 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 numConf PROGMEM = { 0, 200, 70, WA_CENTER };
const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 88, 3, WA_CENTER }; const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 88, 3, WA_CENTER };
const WidgetConfig apName2Conf PROGMEM = { TFT_FRAMEWDT, 120, 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 numtxtFmt[] PROGMEM = "%d";
const char rssiFmt[] PROGMEM = "WiFi %d"; const char rssiFmt[] PROGMEM = "WiFi %d";
const char iptxtFmt[] PROGMEM = "%s"; const char iptxtFmt[] PROGMEM = "%s";
const char voltxtFmt[] PROGMEM = "%d"; const char voltxtFmt[] PROGMEM = "\023\025%d";
const char bitrateFmt[] PROGMEM = "%d kBs"; const char bitrateFmt[] PROGMEM = "%d kBs";
/* MOVES */ /* { left, top, width } */ /* MOVES */ /* { left, top, width } */

View File

@@ -57,7 +57,7 @@ const VUBandsConfig bandsConf PROGMEM = { 24, 100, 4, 2, 10, 4 };
const char numtxtFmt[] PROGMEM = "%d"; const char numtxtFmt[] PROGMEM = "%d";
const char rssiFmt[] PROGMEM = "WiFi %d"; const char rssiFmt[] PROGMEM = "WiFi %d";
const char iptxtFmt[] PROGMEM = "\010 %s"; 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"; const char bitrateFmt[] PROGMEM = "%d kBs";
/* MOVES */ /* { left, top, width } */ /* MOVES */ /* { left, top, width } */

View File

@@ -39,7 +39,7 @@ const WidgetConfig bootstrConf PROGMEM = { 0, 243, 1, WA_CENTER };
const WidgetConfig bitrateConf PROGMEM = { 6, 62, 2, WA_RIGHT }; const WidgetConfig bitrateConf PROGMEM = { 6, 62, 2, WA_RIGHT };
const WidgetConfig voltxtConf PROGMEM = { 0, DSP_HEIGHT-38, 2, WA_CENTER }; 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 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 numConf PROGMEM = { 0, 200, 70, WA_CENTER };
const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 88, 3, WA_CENTER }; const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 88, 3, WA_CENTER };
const WidgetConfig apName2Conf PROGMEM = { TFT_FRAMEWDT, 120, 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 numtxtFmt[] PROGMEM = "%d";
const char rssiFmt[] PROGMEM = "WiFi %d"; const char rssiFmt[] PROGMEM = "WiFi %d";
const char iptxtFmt[] PROGMEM = "%s"; const char iptxtFmt[] PROGMEM = "%s";
const char voltxtFmt[] PROGMEM = "%d"; const char voltxtFmt[] PROGMEM = "\023\025%d";
const char bitrateFmt[] PROGMEM = "%d kBs"; const char bitrateFmt[] PROGMEM = "%d kBs";
/* MOVES */ /* { left, top, width } */ /* MOVES */ /* { left, top, width } */