diff --git a/README.md b/README.md
index 11f6cf9..7b7927b 100644
--- a/README.md
+++ b/README.md
@@ -234,6 +234,11 @@ Work is in progress...
---
## Version history
+### v0.9.399
+**!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!** \
+- added a screensaver mode, configurable via the web interface.
+- changes to the tone control algorithm for the VS1053.
+
### v0.9.390
- updated the VU meter algorithms - shamelessly borrowed from @schreibfaul1, ([thanks a lot!](https://github.com/schreibfaul1/ESP32-audioI2S/blob/1296374fc513a6d6bfaa3b1ca08f6ba938b18d99/src/Audio.cpp#L5030))
- fixed the magic error "HSPI" redefined.
diff --git a/yoRadio/data/www/script.js.gz b/yoRadio/data/www/script.js.gz
index de669c9..c332549 100644
Binary files a/yoRadio/data/www/script.js.gz and b/yoRadio/data/www/script.js.gz differ
diff --git a/yoRadio/data/www/settings.html b/yoRadio/data/www/settings.html
index 0c09f8a..87b9fdb 100644
--- a/yoRadio/data/www/settings.html
+++ b/yoRadio/data/www/settings.html
@@ -68,6 +68,14 @@
+
screensaver
+
+
screensaver enabled
+
+ screensaver timeout (sec)
+
+
+
Controls
diff --git a/yoRadio/src/audioVS1053/audioVS1053Ex.cpp b/yoRadio/src/audioVS1053/audioVS1053Ex.cpp
index bce51c5..464ac5f 100644
--- a/yoRadio/src/audioVS1053/audioVS1053Ex.cpp
+++ b/yoRadio/src/audioVS1053/audioVS1053Ex.cpp
@@ -340,26 +340,26 @@ void Audio::setVolume(uint8_t vol){
// Input value is 0..21. 21 is the loudest.
// Clicking reduced by using 0xf8 to 0x00 as limits.
uint16_t value; // Value to send to SCI_VOL
- uint8_t valueL, valueR;
- int16_t balance_map = map(m_balance, -16, 16, -100, 100);
-
- valueL = vol;
+ uint8_t valueL, valueR;
+ int16_t balance_map = map(m_balance, -16, 16, -100, 100);
+
+ valueL = vol;
valueR = vol;
if (balance_map < 0) {
valueR = (float)valueR-(float)valueR * abs((float)balance_map)/100;
} else if (balance_map > 0) {
- valueL = (float)valueL-(float)valueL * abs((float)balance_map)/100;
+ valueL = (float)valueL-(float)valueL * abs((float)balance_map)/100;
}
curvol = vol;
- uint8_t lgvolL = VS1053VOL(valueL);
- uint8_t lgvolR = VS1053VOL(valueR);
- if(lgvolL==VS1053VOLM) lgvolL=0;
- if(lgvolR==VS1053VOLM) lgvolR=0;
- valueL=map(lgvolL, 0, 254, 0xF8, 0x00);
- valueR=map(lgvolR, 0, 254, 0xF8, 0x00);
- value=(valueL << 8) | valueR;
- write_register(SCI_VOL, value);
+ uint8_t lgvolL = VS1053VOL(valueL);
+ uint8_t lgvolR = VS1053VOL(valueR);
+ if(lgvolL==VS1053VOLM) lgvolL=0;
+ if(lgvolR==VS1053VOLM) lgvolR=0;
+ valueL=map(lgvolL, 0, 254, 0xF8, 0x00);
+ valueR=map(lgvolR, 0, 254, 0xF8, 0x00);
+ value=(valueL << 8) | valueR;
+ write_register(SCI_VOL, value);
/* uint16_t value; // Value to send to SCI_VOL
if(vol > 21) vol=21;
@@ -386,23 +386,39 @@ void Audio::setTone(int8_t *rtone){ // Set bass/treble (4
write_register(SCI_BASS, value); // Volume left and right
}
/*
-Name Bits Description
-ST AMPLITUDE 15:12 Treble Control in 1.5 dB steps (-8..7, 0 = off)
-ST FREQLIMIT 11:8 Lower limit frequency in 1000 Hz steps (1..15) // 1000..15000
-SB AMPLITUDE 7:4 Bass Enhancement in 1 dB steps (0..15, 0 = off)
-SB FREQLIMIT 3:0 Lower limit frequency in 10 Hz steps (2..15) // 20..150
+Name Bits Description
+ST AMPLITUDE 15:12 Treble Control in 1.5 dB steps (-8..7, 0 = off)
+ST FREQLIMIT 11:8 Lower limit frequency in 1000 Hz steps (1..15) // 1000..15000
+SB AMPLITUDE 7:4 Bass Enhancement in 1 dB steps (0..15, 0 = off)
+SB FREQLIMIT 3:0 Lower limit frequency in 10 Hz steps (2..15) // 20..150
+*/
+/*
+void Audio::setTone(int8_t gainLowPass, int8_t gainBandPass, int8_t gainHighPass){
+ if(gainLowPass<0) gainLowPass=0;
+ if(gainLowPass>15) gainLowPass=15;
+ if(gainBandPass<0) gainBandPass=0;
+ if(gainBandPass>13) gainBandPass=13;
+ int8_t rtone[] = {(int8_t)map(gainHighPass, -16, 16, -8, 7), (int8_t)(2+gainBandPass), gainLowPass, (int8_t)(15-gainBandPass)};
+ setTone(rtone);
+}
*/
void Audio::setTone(int8_t gainLowPass, int8_t gainBandPass, int8_t gainHighPass){
- if(gainLowPass<0) gainLowPass=0;
- if(gainLowPass>15) gainLowPass=15;
- if(gainBandPass<0) gainBandPass=0;
- if(gainBandPass>13) gainBandPass=13;
- int8_t rtone[] = {(int8_t)map(gainHighPass, -16, 16, -8, 7), (int8_t)(2+gainBandPass), gainLowPass, (int8_t)(15-gainBandPass)};
- setTone(rtone);
+ gainHighPass = constrain(gainHighPass, -16, 16);
+ gainBandPass = constrain(gainBandPass, -16, 16);
+ gainLowPass = constrain(gainLowPass, -16, 16);
+
+ uint8_t trebleFreqLimit = map(-gainBandPass, -16, 16, 1, 15);
+ uint8_t bassFreqLimit = map(gainBandPass, -16, 16, 2, 15);
+ uint8_t st_amplitude = map(gainHighPass, -16, 16, -8, 7);
+ uint8_t sb_amplitude = map(gainLowPass, -16, 16, 0, 15);
+ uint16_t sci_bass = (st_amplitude << 12) | (trebleFreqLimit << 8) |
+ (sb_amplitude << 4) | bassFreqLimit;
+ write_register(SCI_BASS, sci_bass);
}
+
void Audio::setBalance(int8_t bal){
- m_balance = bal;
- setVolume(curvol);
+ m_balance = bal;
+ setVolume(curvol);
}
//---------------------------------------------------------------------------------------------------------------------
uint8_t Audio::getVolume() // Get the currenet volume setting.
diff --git a/yoRadio/src/core/common.h b/yoRadio/src/core/common.h
index 08a4d1d..2c20da4 100644
--- a/yoRadio/src/core/common.h
+++ b/yoRadio/src/core/common.h
@@ -1,8 +1,8 @@
#ifndef COMMON_H
#define COMMON_H
-enum displayMode_e { PLAYER, VOL, STATIONS, NUMBERS, LOST, UPDATING, INFO, SETTINGS, TIMEZONE, WIFI, CLEAR, SLEEPING, SDCHANGE };
-enum pages_e : uint8_t { PG_PLAYER=0, PG_DIALOG=1, PG_PLAYLIST=2 };
+enum displayMode_e { PLAYER, VOL, STATIONS, NUMBERS, LOST, UPDATING, INFO, SETTINGS, TIMEZONE, WIFI, CLEAR, SLEEPING, SDCHANGE, SCREENSAVER };
+enum pages_e : uint8_t { PG_PLAYER=0, PG_DIALOG=1, PG_PLAYLIST=2, PG_SCREENSAVER=3 };
enum displayRequestType_e { BOOTSTRING, NEWMODE, CLOCK, NEWTITLE, NEWSTATION, NEXTSTATION, DRAWPLAYLIST, DRAWVOL, DBITRATE, AUDIOINFO, SHOWVUMETER, DSPRSSI, SHOWWEATHER, NEWWEATHER, PSTOP, PSTART, DSP_START, WAITFORSD, SDFILEINDEX, NEWIP, NOPE };
struct requestParams_t
diff --git a/yoRadio/src/core/config.cpp b/yoRadio/src/core/config.cpp
index 91a8c31..73c83a0 100644
--- a/yoRadio/src/core/config.cpp
+++ b/yoRadio/src/core/config.cpp
@@ -33,6 +33,8 @@ bool Config::_isFSempty() {
void Config::init() {
EEPROM.begin(EEPROM_SIZE);
sdResumePos = 0;
+ screensaverTicks = 0;
+ isScreensaver = false;
bootInfo();
#if RTCSUPPORTED
_rtcFound = false;
@@ -86,6 +88,10 @@ void Config::_setupVersion(){
uint16_t currentVersion = store.version;
switch(currentVersion){
case 1:
+ saveValue(&store.screensaverEnabled, false);
+ saveValue(&store.screensaverTimeout, (uint16_t)20);
+ break;
+ case 2:
break;
default:
break;
@@ -339,6 +345,8 @@ void Config::setDefaults() {
store.forcemono = false;
store.i2sinternal = false;
store.rotate90 = false;
+ store.screensaverEnabled = false;
+ store.screensaverTimeout = 20;
eepromWrite(EEPROM_START, store);
}
diff --git a/yoRadio/src/core/config.h b/yoRadio/src/core/config.h
index d965767..7fbb2bc 100644
--- a/yoRadio/src/core/config.h
+++ b/yoRadio/src/core/config.h
@@ -45,7 +45,7 @@
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
#define ESP_ARDUINO_3 1
#endif
-#define CONFIG_VERSION 1
+#define CONFIG_VERSION 2
enum playMode_e : uint8_t { PM_WEB=0, PM_SDCARD=1 };
enum BitrateFormat { BF_UNCNOWN, BF_MP3, BF_AAC, BF_FLAC, BF_OGG, BF_WAV };
@@ -133,6 +133,8 @@ struct config_t
bool forcemono;
bool i2sinternal;
bool rotate90;
+ bool screensaverEnabled;
+ uint16_t screensaverTimeout;
};
#if IR_PIN!=255
@@ -175,6 +177,8 @@ class Config {
uint32_t sdResumePos;
bool emptyFS;
uint16_t vuThreshold;
+ uint16_t screensaverTicks;
+ bool isScreensaver;
public:
Config() {};
//void save();
diff --git a/yoRadio/src/core/controls.cpp b/yoRadio/src/core/controls.cpp
index a8c2a7c..c8004c8 100644
--- a/yoRadio/src/core/controls.cpp
+++ b/yoRadio/src/core/controls.cpp
@@ -252,6 +252,10 @@ void irLoop() {
if(config.ircodes.irVals[target][j]==irResults.value){
if (network.status != CONNECTED && network.status!=SDREADY && target!=IR_AST) return;
if(target!=IR_AST && display.mode()==LOST) return;
+ if (display.mode() == SCREENSAVER) {
+ display.putRequest(NEWMODE, PLAYER);
+ return;
+ }
switch (target){
case IR_PLAY: {
irBlink();
@@ -483,6 +487,12 @@ void onBtnClick(int id) {
if (display.mode() == PLAYER) {
player.toggle();
}
+ if (display.mode() == SCREENSAVER) {
+ display.putRequest(NEWMODE, PLAYER);
+ #ifdef DSP_LCD
+ delay(200);
+ #endif
+ }
if (display.mode() == STATIONS) {
display.putRequest(NEWMODE, PLAYER);
#ifdef DSP_LCD
@@ -530,6 +540,10 @@ void onBtnClick(int id) {
}
void onBtnDoubleClick(int id) {
+ if (display.mode() == SCREENSAVER) {
+ display.putRequest(NEWMODE, PLAYER);
+ return;
+ }
switch ((controlEvt_e)id) {
case EVT_BTNLEFT: {
if (display.mode() != PLAYER) return;
diff --git a/yoRadio/src/core/display.cpp b/yoRadio/src/core/display.cpp
index 0737a48..0736b2f 100644
--- a/yoRadio/src/core/display.cpp
+++ b/yoRadio/src/core/display.cpp
@@ -16,7 +16,7 @@ Nextion nextion;
//============================================================================================================================
DspCore dsp;
-Page *pages[] = { new Page(), new Page(), new Page() };
+Page *pages[] = { new Page(), new Page(), new Page(), new Page() };
#ifndef DSQ_SEND_DELAY
#define DSQ_SEND_DELAY portMAX_DELAY
@@ -153,6 +153,7 @@ void Display::_buildPager(){
#endif
if(_vuwidget) pages[PG_PLAYER]->addWidget( _vuwidget);
pages[PG_PLAYER]->addWidget(&_clock);
+ pages[PG_SCREENSAVER]->addWidget(&_clock);
pages[PG_PLAYER]->addPage(&_footer);
if(_metabackground) pages[PG_DIALOG]->addWidget( _metabackground);
@@ -267,6 +268,7 @@ void Display::_swichMode(displayMode_e newmode) {
_mode = newmode;
dsp.setScrollId(NULL);
if (newmode == PLAYER) {
+ _clock.moveBack();
#ifdef DSP_LCD
dsp.clearDsp();
#endif
@@ -278,9 +280,17 @@ void Display::_swichMode(displayMode_e newmode) {
_meta.setAlign(metaConf.widget.align);
_meta.setText(config.station.name);
_nums.setText("");
+ config.isScreensaver = false;
_pager.setPage( pages[PG_PLAYER]);
pm.on_display_player();
}
+ if (newmode == SCREENSAVER) {
+ config.isScreensaver = true;
+ _pager.setPage( pages[PG_SCREENSAVER]);
+ }else{
+ config.screensaverTicks=SCREENSAVERSTARTUPDELAY;
+ config.isScreensaver = false;
+ }
if (newmode == VOL) {
#ifndef HIDE_IP
_showDialog(const_DlgVolume);
@@ -377,7 +387,7 @@ void Display::loop() {
switch (request.type){
case NEWMODE: _swichMode((displayMode_e)request.payload); break;
case CLOCK:
- if(_mode==PLAYER) _time();
+ if(_mode==PLAYER || _mode==SCREENSAVER) _time();
/*#ifdef USE_NEXTION
if(_mode==TIMEZONE) nextion.localTime(network.timeinfo);
if(_mode==INFO) nextion.rssi();
@@ -522,6 +532,8 @@ void Display::_time(bool redraw) {
config.setBrightness();
}
#endif
+ if(config.isScreensaver && network.timeinfo.tm_sec % 60 == 0)
+ _clock.moveTo({clockConf.left, random(TFT_FRAMEWDT+clockConf.textsize, (dsp.height()-TFT_FRAMEWDT*2)), 0});
_clock.draw();
/*#ifdef USE_NEXTION
nextion.printClock(network.timeinfo);
diff --git a/yoRadio/src/core/netserver.cpp b/yoRadio/src/core/netserver.cpp
index ce0a47a..c7786b8 100644
--- a/yoRadio/src/core/netserver.cpp
+++ b/yoRadio/src/core/netserver.cpp
@@ -294,7 +294,7 @@ void NetServer::processQueue(){
config.store.softapdelay,
config.vuThreshold);
break;
- case GETSCREEN: sprintf (wsbuf, "{\"flip\":%d,\"inv\":%d,\"nump\":%d,\"tsf\":%d,\"tsd\":%d,\"dspon\":%d,\"br\":%d,\"con\":%d}",
+ case GETSCREEN: sprintf (wsbuf, "{\"flip\":%d,\"inv\":%d,\"nump\":%d,\"tsf\":%d,\"tsd\":%d,\"dspon\":%d,\"br\":%d,\"con\":%d,\"scre\":%d,\"scrt\":%d}",
config.store.flipscreen,
config.store.invertdisplay,
config.store.numplaylist,
@@ -302,7 +302,9 @@ void NetServer::processQueue(){
config.store.dbgtouch,
config.store.dspon,
config.store.brightness,
- config.store.contrast);
+ config.store.contrast,
+ config.store.screensaverEnabled,
+ config.store.screensaverTimeout);
break;
case GETTIMEZONE: sprintf (wsbuf, "{\"tzh\":%d,\"tzm\":%d,\"sntp1\":\"%s\",\"sntp2\":\"%s\"}",
config.store.tzHour,
@@ -475,6 +477,23 @@ void NetServer::onWsMessage(void *arg, uint8_t *data, size_t len, uint8_t client
display.setContrast();
return;
}
+ if (strcmp(cmd, "screensaverenabled") == 0) {
+ bool valb = static_cast(atoi(val));
+ config.saveValue(&config.store.screensaverEnabled, valb);
+ #ifndef DSP_LCD
+ display.putRequest(NEWMODE, PLAYER);
+ #endif
+ return;
+ }
+ if (strcmp(cmd, "screensavertimeout") == 0) {
+ uint16_t valb = atoi(val);
+ valb = constrain(valb,0,65520);
+ config.saveValue(&config.store.screensaverTimeout, valb);
+ #ifndef DSP_LCD
+ display.putRequest(NEWMODE, PLAYER);
+ #endif
+ return;
+ }
if (strcmp(cmd, "tzh") == 0) {
int8_t vali = atoi(val);
config.saveValue(&config.store.tzHour, vali);
diff --git a/yoRadio/src/core/network.cpp b/yoRadio/src/core/network.cpp
index a8b60fe..31024c4 100644
--- a/yoRadio/src/core/network.cpp
+++ b/yoRadio/src/core/network.cpp
@@ -49,6 +49,11 @@ void ticks() {
network.forceWeather = true;
}
}
+#ifndef DSP_LCD
+ if(config.store.screensaverEnabled && display.mode()==PLAYER && !player.isRunning()){
+ if(config.screensaverTicks++ > config.store.screensaverTimeout+SCREENSAVERSTARTUPDELAY) display.putRequest(NEWMODE, SCREENSAVER);
+ }
+#endif
#if RTCSUPPORTED
if(config.isRTCFound()){
rtc.getTime(&network.timeinfo);
diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h
index d9fe1da..e82a3c5 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.9.390"
+#define YOVERSION "0.9.399"
/*******************************************************
DO NOT EDIT THIS FILE.
@@ -479,4 +479,7 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#define HOOPSENb 2
#endif
+#ifndef SCREENSAVERSTARTUPDELAY
+#define SCREENSAVERSTARTUPDELAY 5
+#endif
#endif
diff --git a/yoRadio/src/core/player.cpp b/yoRadio/src/core/player.cpp
index b2e8021..819a2e5 100644
--- a/yoRadio/src/core/player.cpp
+++ b/yoRadio/src/core/player.cpp
@@ -190,6 +190,7 @@ void Player::_play(uint16_t stationId) {
config.setDspOn(1);
config.vuThreshold = 0;
//display.putRequest(PSTOP);
+ config.screensaverTicks=SCREENSAVERSTARTUPDELAY;
if(config.getMode()!=PM_SDCARD) {
display.putRequest(PSTOP);
}
@@ -224,6 +225,7 @@ void Player::_play(uint16_t stationId) {
config.setSmartStart(1);
netserver.requestOnChange(MODE, 0);
setOutputPins(true);
+ display.putRequest(NEWMODE, PLAYER);
display.putRequest(PSTART);
if (player_on_start_play) player_on_start_play();
pm.on_start_play();
diff --git a/yoRadio/src/core/sdmanager.cpp b/yoRadio/src/core/sdmanager.cpp
index 85fbf69..fa1c68f 100644
--- a/yoRadio/src/core/sdmanager.cpp
+++ b/yoRadio/src/core/sdmanager.cpp
@@ -5,7 +5,7 @@
#include "display.h"
#if defined(SD_SPIPINS) || SD_HSPI
-SPIClass SDSPI(HSPI);
+SPIClass SDSPI(HOOPSENb);
#define SDREALSPI SDSPI
#else
#define SDREALSPI SPI
diff --git a/yoRadio/src/displays/conf/displayILI9488conf.h b/yoRadio/src/displays/conf/displayILI9488conf.h
index d29c540..72824b9 100644
--- a/yoRadio/src/displays/conf/displayILI9488conf.h
+++ b/yoRadio/src/displays/conf/displayILI9488conf.h
@@ -55,7 +55,7 @@ const ProgressConfig bootPrgConf PROGMEM = { 90, 14, 4 };
const BitrateConfig fullbitrateConf PROGMEM = {{DSP_WIDTH-TFT_FRAMEWDT-38, 59, 2, WA_LEFT}, 42 };
/* BANDS */ /* { onebandwidth, onebandheight, bandsHspace, bandsVspace, numofbands, fadespeed } */
-const VUBandsConfig bandsConf PROGMEM = { 32, 130, 4, 2, 10, 10 };
+const VUBandsConfig bandsConf PROGMEM = { 32, 130, 4, 2, 10, 3 };
/* STRINGS */
const char numtxtFmt[] PROGMEM = "%d";
diff --git a/yoRadio/src/displays/displayGC9A01A.cpp b/yoRadio/src/displays/displayGC9A01A.cpp
index 9b8d262..d4b2194 100644
--- a/yoRadio/src/displays/displayGC9A01A.cpp
+++ b/yoRadio/src/displays/displayGC9A01A.cpp
@@ -87,7 +87,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
- print(_bufforseconds); /* print seconds */
+ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1);
setFont(&DS_DIGI42pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -101,7 +101,7 @@ void DspCore::_clockDate(){
dsp.fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10);
- print(_dateBuf); /* print date */
+ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -130,8 +130,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
- drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
- drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
+ if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
+ if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -148,6 +148,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
_getTimeBounds();
clockRightSpace = (width()-_timewidth-CHARWIDTH*3*2-36)/2;
_clockTime();
+ if(!config.isScreensaver)
/*if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) */_clockDate();
}
_clockSeconds();
diff --git a/yoRadio/src/displays/displayILI9225.cpp b/yoRadio/src/displays/displayILI9225.cpp
index d9c7419..1948b52 100644
--- a/yoRadio/src/displays/displayILI9225.cpp
+++ b/yoRadio/src/displays/displayILI9225.cpp
@@ -149,7 +149,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*2*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
- print(_bufforseconds); /* print seconds */
+ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
}
void DspCore::_clockDate(){
@@ -157,7 +157,7 @@ void DspCore::_clockDate(){
fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10);
- print(_dateBuf); /* print date */
+ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -185,8 +185,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
- drawFastVLine(width()-clockRightSpace-CHARWIDTH*2*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
- drawFastHLine(width()-clockRightSpace-CHARWIDTH*2*2-18, clockTop-clockTimeHeight+21, 32, config.theme.div); /*divider hor*/
+ if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*2*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
+ if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*2*2-18, clockTop-clockTimeHeight+21, 32, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -201,7 +201,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
- if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
+ if(!config.isScreensaver)
+ if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}
diff --git a/yoRadio/src/displays/displayILI9341.cpp b/yoRadio/src/displays/displayILI9341.cpp
index bcb80f1..e97f2ba 100644
--- a/yoRadio/src/displays/displayILI9341.cpp
+++ b/yoRadio/src/displays/displayILI9341.cpp
@@ -81,7 +81,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
- print(_bufforseconds);
+ if(!config.isScreensaver) print(_bufforseconds);
setTextSize(1);
setFont(&DS_DIGI42pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -95,7 +95,7 @@ void DspCore::_clockDate(){
dsp.fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10);
- print(_dateBuf); /* print date */
+ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -123,8 +123,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
- drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
- drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
+ if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
+ if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -139,7 +139,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
- if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
+ if(!config.isScreensaver)
+ if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}
diff --git a/yoRadio/src/displays/displayILI9488.cpp b/yoRadio/src/displays/displayILI9488.cpp
index 395f528..528c1f2 100644
--- a/yoRadio/src/displays/displayILI9488.cpp
+++ b/yoRadio/src/displays/displayILI9488.cpp
@@ -88,7 +88,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*4*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
- print(_bufforseconds); /* print seconds */
+ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1);
setFont(&DS_DIGI56pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -103,7 +103,7 @@ void DspCore::_clockDate(){
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+15);
setTextSize(2);
- print(_dateBuf); /* print date */
+ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -131,8 +131,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
- drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/
- drawFastHLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight+37, 59, config.theme.div); /*divider hor*/
+ if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/
+ if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight+37, 59, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH*2;
@@ -147,7 +147,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
- if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
+ if(!config.isScreensaver)
+ if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}
diff --git a/yoRadio/src/displays/displayN5110.cpp b/yoRadio/src/displays/displayN5110.cpp
index 03f73c0..aff0806 100644
--- a/yoRadio/src/displays/displayN5110.cpp
+++ b/yoRadio/src/displays/displayN5110.cpp
@@ -166,7 +166,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
- dsp.fillRect(_timeleft, clockTop-clockTimeHeight, _timewidth+CHARWIDTH*2+2, clockTimeHeight, config.theme.background);
+ dsp.fillRect(_timeleft, clockTop-clockTimeHeight, _timewidth+CHARWIDTH*2+2, clockTimeHeight+2, config.theme.background);
//dsp.fillRect(_timeleft, clockTop-clockTimeHeight, _timewidth+CHARWIDTH*3*2+24, clockTimeHeight+10+CHARHEIGHT, config.theme.background);
}
diff --git a/yoRadio/src/displays/displaySH1106.cpp b/yoRadio/src/displays/displaySH1106.cpp
index 6e4b969..8425b5e 100644
--- a/yoRadio/src/displays/displaySH1106.cpp
+++ b/yoRadio/src/displays/displaySH1106.cpp
@@ -146,7 +146,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
- dsp.fillRect(_timeleft, clockTop, _timewidth, clockTimeHeight*CHARHEIGHT, config.theme.background);
+ dsp.fillRect(_timeleft, clockTop, _timewidth+14, clockTimeHeight*CHARHEIGHT, config.theme.background);
}
void DspCore::startWrite(void) { }
diff --git a/yoRadio/src/displays/displaySSD1305.cpp b/yoRadio/src/displays/displaySSD1305.cpp
index 22269c6..7208dd2 100644
--- a/yoRadio/src/displays/displaySSD1305.cpp
+++ b/yoRadio/src/displays/displaySSD1305.cpp
@@ -154,7 +154,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
- dsp.fillRect(_timeleft, clockTop, _timewidth, clockTimeHeight*CHARHEIGHT, config.theme.background);
+ dsp.fillRect(_timeleft, clockTop, _timewidth+14, clockTimeHeight*CHARHEIGHT, config.theme.background);
}
void DspCore::startWrite(void) { }
diff --git a/yoRadio/src/displays/displaySSD1306.cpp b/yoRadio/src/displays/displaySSD1306.cpp
index 23b436c..a5d3e34 100644
--- a/yoRadio/src/displays/displaySSD1306.cpp
+++ b/yoRadio/src/displays/displaySSD1306.cpp
@@ -165,7 +165,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
- dsp.fillRect(_timeleft, clockTop, _timewidth, clockTimeHeight*CHARHEIGHT, config.theme.background);
+ dsp.fillRect(_timeleft, clockTop, _timewidth+14, clockTimeHeight*CHARHEIGHT, config.theme.background);
}
void DspCore::startWrite(void) { }
diff --git a/yoRadio/src/displays/displayST7789.cpp b/yoRadio/src/displays/displayST7789.cpp
index 0c41a2f..2354b9b 100644
--- a/yoRadio/src/displays/displayST7789.cpp
+++ b/yoRadio/src/displays/displayST7789.cpp
@@ -88,7 +88,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
- print(_bufforseconds); /* print seconds */
+ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1);
setFont(&DS_DIGI42pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -102,7 +102,7 @@ void DspCore::_clockDate(){
dsp.fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10);
- print(_dateBuf); /* print date */
+ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -130,8 +130,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
- drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
- drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
+ if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
+ if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -146,7 +146,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
- if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
+ if(!config.isScreensaver)
+ if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}
diff --git a/yoRadio/src/displays/displayST7796.cpp b/yoRadio/src/displays/displayST7796.cpp
index eae6c08..352806b 100644
--- a/yoRadio/src/displays/displayST7796.cpp
+++ b/yoRadio/src/displays/displayST7796.cpp
@@ -87,7 +87,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*4*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
- print(_bufforseconds); /* print seconds */
+ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1);
setFont(&DS_DIGI56pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -102,7 +102,7 @@ void DspCore::_clockDate(){
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+15);
setTextSize(2);
- print(_dateBuf); /* print date */
+ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -130,8 +130,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
- drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/
- drawFastHLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight+37, 59, config.theme.div); /*divider hor*/
+ if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/
+ if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight+37, 59, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH*2;
@@ -146,7 +146,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
- if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
+ if(!config.isScreensaver)
+ if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}
diff --git a/yoRadio/src/displays/displayST7920.cpp b/yoRadio/src/displays/displayST7920.cpp
index 1722319..a52cbbc 100644
--- a/yoRadio/src/displays/displayST7920.cpp
+++ b/yoRadio/src/displays/displayST7920.cpp
@@ -137,7 +137,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
- dsp.fillRect(_timeleft, clockTop, _timewidth, clockTimeHeight*CHARHEIGHT, config.theme.background);
+ dsp.fillRect(_timeleft, clockTop, _timewidth+14, clockTimeHeight*CHARHEIGHT, config.theme.background);
}
void DspCore::startWrite(void) { }