diff --git a/yoRadio/fonts/glcdfont.c b/yoRadio/fonts/glcdfont.c index 1b35c7e..cec242f 100644 --- a/yoRadio/fonts/glcdfont.c +++ b/yoRadio/fonts/glcdfont.c @@ -14,14 +14,14 @@ static const unsigned char font[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, -0x3E, 0x55, 0x51, 0x55, 0x3E, -0x3E, 0x6B, 0x6F, 0x6B, 0x3E, -0x0C, 0x1E, 0x3C, 0x1E, 0x0C, -0x08, 0x1C, 0x3E, 0x1C, 0x08, -0x1C, 0x4A, 0x7F, 0x4A, 0x1C, -0x18, 0x5C, 0x7F, 0x5C, 0x18, +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, -0x7F, 0x63, 0x63, 0x63, 0x7F, +0x7A, 0x00, 0x7E, 0x12, 0x1E, //<<-- 0x06, 0x09, 0x09, 0x06, 0x00, 0x7F, 0x63, 0x6B, 0x63, 0x7F, 0x30, 0x48, 0x4D, 0x33, 0x07, diff --git a/yoRadio/locale/displayL10n_en.h b/yoRadio/locale/displayL10n_en.h index 948844f..d9e065b 100644 --- a/yoRadio/locale/displayL10n_en.h +++ b/yoRadio/locale/displayL10n_en.h @@ -70,7 +70,11 @@ const char apNameTxt[] PROGMEM = "AP NAME"; const char apPassTxt[] PROGMEM = "PASSWORD"; const char bootstrFmt[] PROGMEM = "Trying to %s"; const char apSettFmt[] PROGMEM = "SETTINGS PAGE ON: HTTP://%s/"; -const char weatherFmt[] PROGMEM = "%s, %.1f\011C \007 feels like: %.1f\011C \007 pressure: %d мм * humidity: %s%% \007 wind: [%s] %.1f m/s"; +#if EXT_WEATHER +const char weatherFmt[] PROGMEM = "%s, %.1f\011C \007 feels like: %.1f\011C \007 pressure: %d мм * humidity: %s%% \007 wind: %s\027%.1f m/s"; +#else +const char weatherFmt[] PROGMEM = "%s, %.1f\011C \007 pressure: %d mm \007 humidity: %s%%"; +#endif const char weatherUnits[] PROGMEM = "metric"; /* standard, metric, imperial */ const char weatherLang[] PROGMEM = "en"; /* https://openweathermap.org/current#multi */ diff --git a/yoRadio/locale/displayL10n_ru.h b/yoRadio/locale/displayL10n_ru.h index 80b278b..1eb80b3 100644 --- a/yoRadio/locale/displayL10n_ru.h +++ b/yoRadio/locale/displayL10n_ru.h @@ -70,7 +70,11 @@ const char apNameTxt[] PROGMEM = "ТОЧКА ДОСТУПА"; const char apPassTxt[] PROGMEM = "ПАРОЛЬ"; const char bootstrFmt[] PROGMEM = "Соединяюсь с %s"; const char apSettFmt[] PROGMEM = "НАСТРОЙКИ: HTTP://%s/"; -const char weatherFmt[] PROGMEM = "%s, %.1f\011C \007 ощущается: %.1f\011C \007 давление: %d мм \007 влажность: %s%% \007 ветер: %s\013%.1f м/с"; +#if EXT_WEATHER +const char weatherFmt[] PROGMEM = "%s, %.1f\011C \007 ощущается: %.1f\011C \007 давление: %d мм \007 влажность: %s%% \007 ветер: %s\027%.1f м/с"; +#else +const char weatherFmt[] PROGMEM = "%s, %.1f\011C \007 давление: %d mm \007 влажность: %s%%"; +#endif const char weatherUnits[] PROGMEM = "metric"; /* standard, metric, imperial */ const char weatherLang[] PROGMEM = "ru"; /* https://openweathermap.org/current#multi */ diff --git a/yoRadio/src/core/display.cpp b/yoRadio/src/core/display.cpp index 7585874..14f14b8 100644 --- a/yoRadio/src/core/display.cpp +++ b/yoRadio/src/core/display.cpp @@ -212,7 +212,7 @@ void Display::_start() { if(_weather && config.store.showweather) _weather->setText(const_getWeather); if(_vuwidget) _vuwidget->lock(); - if(_rssi) _rssi->setText(WiFi.RSSI(), rssiFmt); + if(_rssi) _setRSSI(WiFi.RSSI()); #ifndef HIDE_IP if(_volip) _volip->setText(WiFi.localIP().toString().c_str(), iptxtFmt); #endif @@ -408,7 +408,7 @@ void Display::loop() { #endif*/ break; } - case DSPRSSI: if(_rssi){ _rssi->setText(request.payload, rssiFmt); } if (_heapbar && config.store.audioinfo) _heapbar->setValue(player.inBufferFilled()); break; + case DSPRSSI: if(_rssi){ _setRSSI(request.payload); } if (_heapbar && config.store.audioinfo) _heapbar->setValue(player.inBufferFilled()); break; case PSTART: _layoutChange(true); break; case PSTOP: _layoutChange(false); break; case DSP_START: _start(); break; @@ -418,6 +418,21 @@ void Display::loop() { dsp.loop(); } +void Display::_setRSSI(int rssi) { + if(!_rssi) return; +#if RSSI_DIGIT + _rssi->setText(rssi, rssiFmt); + 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); + _rssi->setText(rssiG); +} + void Display::_station() { _meta.setAlign(metaConf.widget.align); _meta.setText(config.station.name); diff --git a/yoRadio/src/core/display.h b/yoRadio/src/core/display.h index 2b85613..914ac9f 100644 --- a/yoRadio/src/core/display.h +++ b/yoRadio/src/core/display.h @@ -78,6 +78,7 @@ class Display { void _bootScreen(); void _setReturnTicker(uint8_t time_s); void _layoutChange(bool played); + void _setRSSI(int rssi); }; #else diff --git a/yoRadio/src/core/network.cpp b/yoRadio/src/core/network.cpp index fbcf5ff..022fb40 100644 --- a/yoRadio/src/core/network.cpp +++ b/yoRadio/src/core/network.cpp @@ -259,7 +259,7 @@ bool getWeather(char *wstr) { if (tmpe == NULL) { Serial.println("## OPENWEATHERMAP ###: feels_like not found !"); return false;} strlcpy(temp, tmps, tmpe - tmps + 1); cursor = tmpe + 2; - float tempfl = atof(temp); + float tempfl = atof(temp); (void)tempfl; tmps = strstr(cursor, "humidity\":"); if (tmps == NULL) { Serial.println("## OPENWEATHERMAP ###: humidity not found !"); return false;} @@ -285,7 +285,7 @@ bool getWeather(char *wstr) { if (tmpe == NULL) { Serial.println("## OPENWEATHERMAP ###: wind speed not found !"); return false;} strlcpy(temp, tmps, tmpe - tmps + 1); cursor = tmpe + 1; - float wind_speed = atof(temp); + float wind_speed = atof(temp); (void)wind_speed; tmps = strstr(cursor, "\"deg\":"); if (tmps == NULL) { Serial.println("## OPENWEATHERMAP ###: wind deg not found !"); return false;} @@ -323,7 +323,11 @@ bool getWeather(char *wstr) { #ifdef WEATHER_FMT_SHORT sprintf(wstr, weatherFmt, tempf, pressi, hum); #else - sprintf(wstr, weatherFmt, desc, tempf, tempfl, pressi, hum, wind[wind_deg], wind_speed); + #if EXT_WEATHER + sprintf(wstr, weatherFmt, desc, tempf, tempfl, pressi, hum, wind[wind_deg], wind_speed); + #else + sprintf(wstr, weatherFmt, desc, tempf, pressi, hum); + #endif #endif network.requestWeatherSync(); return true; diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index 3fffe56..1e8b531 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.979" +#define YOVERSION "0.8.981" /******************************************************* DO NOT EDIT THIS FILE. @@ -285,6 +285,12 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti #ifndef DSP_INVERT_TITLE #define DSP_INVERT_TITLE true // Invert title colors for displays ? #endif +#ifndef EXT_WEATHER + #define EXT_WEATHER true // Extended weather +#endif +#ifndef RSSI_DIGIT + #define RSSI_DIGIT false // Extended weather +#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 b3aa2df..a30e1ad 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 = "VOL %d"; +const char voltxtFmt[] PROGMEM = "\016 %d"; const char bitrateFmt[] PROGMEM = "%d KBS"; /* MOVES */ /* { left, top, width } */ diff --git a/yoRadio/src/displays/conf/displayILI9225conf.h b/yoRadio/src/displays/conf/displayILI9225conf.h index ca9c7cf..944fb32 100644 --- a/yoRadio/src/displays/conf/displayILI9225conf.h +++ b/yoRadio/src/displays/conf/displayILI9225conf.h @@ -57,7 +57,7 @@ const VUBandsConfig bandsConf PROGMEM = { 19, 90, 2, 2, 10, 2 }; /* STRINGS */ const char numtxtFmt[] PROGMEM = "%d"; const char rssiFmt[] PROGMEM = "WiFi %d"; -const char iptxtFmt[] PROGMEM = "IP %s"; +const char iptxtFmt[] PROGMEM = "\010 %s"; const char voltxtFmt[] PROGMEM = "%d"; const char bitrateFmt[] PROGMEM = "%d kBs"; diff --git a/yoRadio/src/displays/conf/displayILI9341conf.h b/yoRadio/src/displays/conf/displayILI9341conf.h index 9b98f9d..47df5cc 100644 --- a/yoRadio/src/displays/conf/displayILI9341conf.h +++ b/yoRadio/src/displays/conf/displayILI9341conf.h @@ -38,7 +38,7 @@ const WidgetConfig bootstrConf PROGMEM = { 0, 182, 1, WA_CENTER }; const WidgetConfig bitrateConf PROGMEM = { 70, 191, 1, WA_LEFT }; const WidgetConfig voltxtConf PROGMEM = { 0, 214, 1, WA_CENTER }; const WidgetConfig iptxtConf PROGMEM = { TFT_FRAMEWDT, 214, 1, WA_LEFT }; -const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, 214, 1, WA_RIGHT }; +const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, 214-8, 2, WA_RIGHT }; const WidgetConfig numConf PROGMEM = { 0, 120+30, 52, WA_CENTER }; const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 66, 2, WA_CENTER }; const WidgetConfig apName2Conf PROGMEM = { TFT_FRAMEWDT, 90, 2, WA_CENTER }; @@ -56,8 +56,8 @@ const VUBandsConfig bandsConf PROGMEM = { 24, 100, 4, 2, 10, 5 }; /* STRINGS */ const char numtxtFmt[] PROGMEM = "%d"; const char rssiFmt[] PROGMEM = "WiFi %d"; -const char iptxtFmt[] PROGMEM = "IP %s"; -const char voltxtFmt[] PROGMEM = "vol %d"; +const char iptxtFmt[] PROGMEM = "\010 %s"; +const char voltxtFmt[] PROGMEM = "\016 %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 e55971c..18e9692 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, 2, WA_RIGHT }; +const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-38-10, 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 }; diff --git a/yoRadio/src/displays/conf/displaySSD1327conf.h b/yoRadio/src/displays/conf/displaySSD1327conf.h index 7e7b696..32d8243 100644 --- a/yoRadio/src/displays/conf/displaySSD1327conf.h +++ b/yoRadio/src/displays/conf/displaySSD1327conf.h @@ -31,6 +31,7 @@ const ScrollConfig weatherConf PROGMEM = {{ TFT_FRAMEWDT, 42, 1, WA_LEFT }, 1 /* BACKGROUNDS */ /* {{ left, top, fontsize, align }, width, height, outlined } */ const FillConfig metaBGConf PROGMEM = {{ 0, 0, 0, WA_LEFT }, DSP_WIDTH, 22, false }; +const FillConfig metaBGConfInv PROGMEM = {{ 0, 22, 0, WA_LEFT }, DSP_WIDTH, 1, false }; const FillConfig volbarConf PROGMEM = {{ TFT_FRAMEWDT, 118, 0, WA_LEFT }, MAX_WIDTH-6*3-4, 5, true }; const FillConfig playlBGConf PROGMEM = {{ 0, 52, 0, WA_LEFT }, DSP_WIDTH, 22, false }; const FillConfig heapbarConf PROGMEM = {{ 0, 127, 0, WA_LEFT }, DSP_WIDTH, 1, false }; diff --git a/yoRadio/src/displays/conf/displayST7789_240conf.h b/yoRadio/src/displays/conf/displayST7789_240conf.h index 76197a8..a06acb6 100644 --- a/yoRadio/src/displays/conf/displayST7789_240conf.h +++ b/yoRadio/src/displays/conf/displayST7789_240conf.h @@ -37,7 +37,7 @@ const WidgetConfig bootstrConf PROGMEM = { 0, 182, 1, WA_CENTER }; const WidgetConfig bitrateConf PROGMEM = { TFT_FRAMEWDT, 188, 1, WA_LEFT }; const WidgetConfig voltxtConf PROGMEM = { 80, 214, 1, WA_RIGHT }; const WidgetConfig iptxtConf PROGMEM = { TFT_FRAMEWDT, 214, 1, WA_LEFT }; -const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, 214, 1, WA_RIGHT }; +const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, 214-6, 2, WA_RIGHT }; const WidgetConfig numConf PROGMEM = { 0, 120+30, 52, WA_CENTER }; const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 66, 2, WA_CENTER }; const WidgetConfig apName2Conf PROGMEM = { TFT_FRAMEWDT, 90, 2, WA_CENTER }; @@ -55,7 +55,7 @@ const VUBandsConfig bandsConf PROGMEM = { 100, 20, 10, 2, 10, 5 }; /* STRINGS */ const char numtxtFmt[] PROGMEM = "%d"; const char rssiFmt[] PROGMEM = "WiFi %d"; -const char iptxtFmt[] PROGMEM = "IP %s"; +const char iptxtFmt[] PROGMEM = "%s"; const char voltxtFmt[] PROGMEM = "%d"; const char bitrateFmt[] PROGMEM = "%d kBs"; diff --git a/yoRadio/src/displays/conf/displayST7789conf.h b/yoRadio/src/displays/conf/displayST7789conf.h index 7b6d423..bd676b4 100644 --- a/yoRadio/src/displays/conf/displayST7789conf.h +++ b/yoRadio/src/displays/conf/displayST7789conf.h @@ -38,7 +38,7 @@ const WidgetConfig bootstrConf PROGMEM = { 0, 182, 1, WA_CENTER }; const WidgetConfig bitrateConf PROGMEM = { 70, 191, 1, WA_LEFT }; const WidgetConfig voltxtConf PROGMEM = { 0, 214, 1, WA_CENTER }; const WidgetConfig iptxtConf PROGMEM = { TFT_FRAMEWDT, 214, 1, WA_LEFT }; -const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, 214, 1, WA_RIGHT }; +const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, 208, 2, WA_RIGHT }; const WidgetConfig numConf PROGMEM = { 0, 120+30, 52, WA_CENTER }; const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 66, 2, WA_CENTER }; const WidgetConfig apName2Conf PROGMEM = { TFT_FRAMEWDT, 90, 2, WA_CENTER }; @@ -56,8 +56,8 @@ const VUBandsConfig bandsConf PROGMEM = { 24, 100, 4, 2, 10, 4 }; /* STRINGS */ const char numtxtFmt[] PROGMEM = "%d"; const char rssiFmt[] PROGMEM = "WiFi %d"; -const char iptxtFmt[] PROGMEM = "IP %s"; -const char voltxtFmt[] PROGMEM = "vol %d"; +const char iptxtFmt[] PROGMEM = "\010 %s"; +const char voltxtFmt[] PROGMEM = "\016 %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 ef28913..62f9edb 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, 2, WA_RIGHT }; +const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-38-16, 4, 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 };