diff --git a/README.md b/README.md index 6a363cf..8d803f1 100644 --- a/README.md +++ b/README.md @@ -301,6 +301,12 @@ Work is in progress... --- ## Version history +#### v0.8.089 +- increased length of SSID string to 30 characters (requires full update + ESP32 Data Upload) +- fixed artifacts when adjusting the volume on OLED displays +- fixed bug with missing current station in playlist on OLED displays +- new parameter DSP_INVERT_TITLE - invert colors in station name for OLED displays (more details in exsamples/myoptions.h) + #### v0.8.03b - added support for ST7796 display - added support for capacitive touch GT911 diff --git a/exsamples/myoptions.h b/exsamples/myoptions.h index 36eee34..620023f 100644 --- a/exsamples/myoptions.h +++ b/exsamples/myoptions.h @@ -142,6 +142,7 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti /* For sample #define ENC_BTNB 36 - next line - #define WAKE_PIN ENC_BTNB */ //#define LIGHT_SENSOR 255 /* Light sensor */ //#define AUTOBACKLIGHT(x) *function* /* Autobacklight function. See options.h for exsample */ +//#define DSP_INVERT_TITLE true /* Invert title colors for OLED displays ? */ /******************************************/ /* IR control */ diff --git a/yoRadio/data/www/settings.html b/yoRadio/data/www/settings.html index 2a381f3..4d6618e 100644 --- a/yoRadio/data/www/settings.html +++ b/yoRadio/data/www/settings.html @@ -129,7 +129,7 @@
ssid - +
pass @@ -139,7 +139,7 @@
ssid - +
pass @@ -149,7 +149,7 @@
ssid - +
pass @@ -159,7 +159,7 @@
ssid - +
pass @@ -169,7 +169,7 @@
ssid - +
pass diff --git a/yoRadio/src/core/config.cpp b/yoRadio/src/core/config.cpp index 714c0ef..4480e56 100644 --- a/yoRadio/src/core/config.cpp +++ b/yoRadio/src/core/config.cpp @@ -434,8 +434,8 @@ bool Config::parseSsid(const char* line, char* ssid, char* pass) { tmpe = strstr(line, "\t"); if (tmpe == NULL) return false; uint16_t pos = tmpe - line; - if (pos > 19 || strlen(line) > 61) return false; - memset(ssid, 0, 20); + if (pos > 29 || strlen(line) > 71) return false; + memset(ssid, 0, 30); strlcpy(ssid, line, pos + 1); memset(pass, 0, 40); strlcpy(pass, line + pos + 1, strlen(line) - pos); @@ -467,11 +467,11 @@ bool Config::initNetwork() { if (!file || file.isDirectory()) { return false; } - char ssidval[20], passval[40]; + char ssidval[30], passval[40]; byte c = 0; while (file.available()) { if (parseSsid(file.readStringUntil('\n').c_str(), ssidval, passval)) { - strlcpy(ssids[c].ssid, ssidval, 20); + strlcpy(ssids[c].ssid, ssidval, 30); strlcpy(ssids[c].password, passval, 40); ssidsCount++; c++; diff --git a/yoRadio/src/core/config.h b/yoRadio/src/core/config.h index 671b1f3..1d49364 100644 --- a/yoRadio/src/core/config.h +++ b/yoRadio/src/core/config.h @@ -123,7 +123,7 @@ struct station_t struct neworkItem { - char ssid[20]; + char ssid[30]; char password[40]; }; diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index 2d18829..17f1156 100644 --- a/yoRadio/src/core/options.h +++ b/yoRadio/src/core/options.h @@ -1,7 +1,7 @@ #ifndef options_h #define options_h -#define VERSION "0.8.03b" +#define VERSION "0.8.089" /******************************************************* DO NOT EDIT THIS FILE. @@ -264,6 +264,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti #endif #define AUTOBACKLIGHT(x) ({uint16_t _lh=(x>AUTOBACKLIGHT_MAX?AUTOBACKLIGHT_MAX:x); map(_lh, AUTOBACKLIGHT_MAX, 0, AUTOBACKLIGHT_MIN, 100);}) // autobacklight function #endif +#ifndef DSP_INVERT_TITLE + #define DSP_INVERT_TITLE true // Invert title colors for OLED displays ? +#endif /* *** ST7735 display submodel *** INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html diff --git a/yoRadio/src/core/telnet.cpp b/yoRadio/src/core/telnet.cpp index f78ef64..991155d 100644 --- a/yoRadio/src/core/telnet.cpp +++ b/yoRadio/src/core/telnet.cpp @@ -422,7 +422,7 @@ void Telnet::on_input(const char* str, byte clientId) { printf(clientId, "##WIFI.STATION#\n> "); return; } - char newssid[20], newpass[40]; + char newssid[30], newpass[40]; if (sscanf(str, "wifi.con(\"%[^\"]\",\"%[^\"]\")", newssid, newpass) == 2 || sscanf(str, "wifi.con(%[^,],%[^)])", newssid, newpass) == 2 || sscanf(str, "wifi.con(%[^ ] %[^)])", newssid, newpass) == 2 || sscanf(str, "wifi %[^ ] %s", newssid, newpass) == 2) { char buf[BUFLEN]; snprintf(buf, BUFLEN, "New SSID: \"%s\" with PASS: \"%s\" for next boot\n> ", newssid, newpass); diff --git a/yoRadio/src/displays/displayN5110.cpp b/yoRadio/src/displays/displayN5110.cpp index 01aeead..a49525a 100644 --- a/yoRadio/src/displays/displayN5110.cpp +++ b/yoRadio/src/displays/displayN5110.cpp @@ -61,6 +61,9 @@ void DspCore::initDisplay() { config.theme.buffer = TFT_FG; config.theme.volbarout = TFT_FG; config.theme.volbarin = TFT_FG; + config.theme.plcurrent = TFT_BG; + config.theme.plcurrentbg = TFT_FG; + config.theme.plcurrentfill = TFT_FG; for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG; setContrast(config.store.contrast); diff --git a/yoRadio/src/displays/displaySH1106.cpp b/yoRadio/src/displays/displaySH1106.cpp index 5282d7b..6e040be 100644 --- a/yoRadio/src/displays/displaySH1106.cpp +++ b/yoRadio/src/displays/displaySH1106.cpp @@ -49,25 +49,7 @@ void DspCore::initDisplay() { Serial.println(F("SH110X allocation failed")); for (;;); // Don't proceed, loop forever } - config.theme.background = TFT_BG; - config.theme.meta = TFT_BG; - config.theme.clock = TFT_FG; - config.theme.weather = TFT_FG; - config.theme.metabg = TFT_FG; - config.theme.metafill = TFT_FG; - config.theme.title1 = TFT_FG; - config.theme.title2 = TFT_FG; - config.theme.rssi = TFT_FG; - config.theme.ip = TFT_FG; - config.theme.vol = TFT_FG; - config.theme.bitrate = TFT_FG; - config.theme.digit = TFT_FG; - config.theme.buffer = TFT_FG; - config.theme.volbarout = TFT_FG; - config.theme.volbarin = TFT_FG; - - for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG; - +#include "tools/oledcolorfix.h" cp437(true); flip(); invert(); diff --git a/yoRadio/src/displays/displaySSD1305.cpp b/yoRadio/src/displays/displaySSD1305.cpp index 90981f8..d304fe0 100644 --- a/yoRadio/src/displays/displaySSD1305.cpp +++ b/yoRadio/src/displays/displaySSD1305.cpp @@ -53,24 +53,7 @@ void DspCore::initDisplay() { Serial.println(F("SSD1305 allocation failed")); for (;;); // Don't proceed, loop forever } - config.theme.background = TFT_BG; - config.theme.meta = TFT_BG; - config.theme.clock = TFT_FG; - config.theme.weather = TFT_FG; - config.theme.metabg = TFT_FG; - config.theme.metafill = TFT_FG; - config.theme.title1 = TFT_FG; - config.theme.title2 = TFT_FG; - config.theme.rssi = TFT_FG; - config.theme.ip = TFT_FG; - config.theme.vol = TFT_FG; - config.theme.bitrate = TFT_FG; - config.theme.digit = TFT_FG; - config.theme.buffer = TFT_FG; - config.theme.volbarout = TFT_FG; - config.theme.volbarin = TFT_FG; - - for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG; +#include "tools/oledcolorfix.h" cp437(true); flip(); diff --git a/yoRadio/src/displays/displaySSD1306.cpp b/yoRadio/src/displays/displaySSD1306.cpp index 087f179..f0f6ed0 100644 --- a/yoRadio/src/displays/displaySSD1306.cpp +++ b/yoRadio/src/displays/displaySSD1306.cpp @@ -45,24 +45,7 @@ void DspCore::initDisplay() { Serial.println(F("SSD1306 allocation failed")); for (;;); // Don't proceed, loop forever } - config.theme.background = TFT_BG; - config.theme.meta = TFT_BG; - config.theme.clock = TFT_FG; - config.theme.weather = TFT_FG; - config.theme.metabg = TFT_FG; - config.theme.metafill = TFT_FG; - config.theme.title1 = TFT_FG; - config.theme.title2 = TFT_FG; - config.theme.rssi = TFT_FG; - config.theme.ip = TFT_FG; - config.theme.vol = TFT_FG; - config.theme.bitrate = TFT_FG; - config.theme.digit = TFT_FG; - config.theme.buffer = TFT_FG; - config.theme.volbarout = TFT_FG; - config.theme.volbarin = TFT_FG; - - for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG; +#include "tools/oledcolorfix.h" cp437(true); flip(); invert(); diff --git a/yoRadio/src/displays/tools/oledcolorfix.h b/yoRadio/src/displays/tools/oledcolorfix.h new file mode 100644 index 0000000..cfd9407 --- /dev/null +++ b/yoRadio/src/displays/tools/oledcolorfix.h @@ -0,0 +1,32 @@ +#ifndef _OLEDCOLORFIX_H_ +#define _OLEDCOLORFIX_H_ + + config.theme.background = TFT_BG; +#if DSP_INVERT_TITLE + config.theme.meta = TFT_BG; + config.theme.metabg = TFT_FG; + config.theme.metafill = TFT_FG; +#else + config.theme.meta = TFT_FG; + config.theme.metabg = TFT_BG; + config.theme.metafill = TFT_BG; +#endif + config.theme.clock = TFT_FG; + config.theme.weather = TFT_FG; + config.theme.title1 = TFT_FG; + config.theme.title2 = TFT_FG; + config.theme.rssi = TFT_FG; + config.theme.ip = TFT_FG; + config.theme.vol = TFT_FG; + config.theme.bitrate = TFT_FG; + config.theme.digit = TFT_FG; + config.theme.buffer = TFT_FG; + config.theme.volbarout = TFT_FG; + config.theme.volbarin = TFT_FG; + config.theme.plcurrent = TFT_BG; + config.theme.plcurrentbg = TFT_FG; + config.theme.plcurrentfill = TFT_FG; + for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG; + + +#endif diff --git a/yoRadio/src/displays/widgets/widgets.cpp b/yoRadio/src/displays/widgets/widgets.cpp index 5b3fadb..c9982c3 100644 --- a/yoRadio/src/displays/widgets/widgets.cpp +++ b/yoRadio/src/displays/widgets/widgets.cpp @@ -376,7 +376,11 @@ void NumWidget::setText(const char* txt) { strlcpy(_text, txt, _buffsize); _getBounds(); if (strcmp(_oldtext, _text) == 0) return; - if (_active) dsp.fillRect(_oldleft == 0 ? _realLeft() : min(_oldleft, _realLeft()), _config.top-_textheight+1, max(_oldtextwidth, _textwidth), _textheight, _bgcolor); + uint16_t realth = _textheight; +#ifdef DSP_OLED + realth = _textheight*CHARHEIGHT; +#endif + if (_active) dsp.fillRect(_oldleft == 0 ? _realLeft() : min(_oldleft, _realLeft()), _config.top-_textheight+1, max(_oldtextwidth, _textwidth), realth, _bgcolor); _oldtextwidth = _textwidth; _oldleft = _realLeft(); if (_active) _draw();