This commit is contained in:
e2002
2024-12-26 09:58:19 +03:00
parent 27e33a1bc8
commit 775590f213
26 changed files with 172 additions and 70 deletions

View File

@@ -234,6 +234,11 @@ Work is in progress...
--- ---
## Version history ## 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 ### 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)) - 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. - fixed the magic error "HSPI" redefined.

Binary file not shown.

View File

@@ -68,6 +68,14 @@
<input type="range" id="slcontrast" class="slider" data-slaveid="slcontrastinfo" name="contrast" min="0" max="100" value="55"> <input type="range" id="slcontrast" class="slider" data-slaveid="slcontrastinfo" name="contrast" min="0" max="100" value="55">
</div> </div>
</div> </div>
<div class="row-title"><span>screensaver</span></div>
<div class="flex-row group group_tft group_oled group_nextion hidden" style="margin-top:20px;">
<div class="checkbox off nous" id="screensaverenabled">screensaver enabled</div>
<div class="inputwrap">
<span class="inputtitle">screensaver timeout (sec)</span>
<input type="number" id="screensavertimeout" class="textinput inputchange" name="screensavertimeout" value="" maxlength="3" min="0" max="65520" />
</div>
</div>
</section> </section>
<section class="group group_controls hidden" id="group_controls"> <section class="group group_controls hidden" id="group_controls">
<div class="title"><span>Controls</span></div><div class="reset" data-name="controls"></div> <div class="title"><span>Controls</span></div><div class="reset" data-name="controls"></div>

View File

@@ -392,6 +392,7 @@ ST FREQLIMIT 11:8 Lower limit frequency in 1000 Hz steps (1..15) // 1000..
SB AMPLITUDE 7:4 Bass Enhancement in 1 dB steps (0..15, 0 = off) 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 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){ void Audio::setTone(int8_t gainLowPass, int8_t gainBandPass, int8_t gainHighPass){
if(gainLowPass<0) gainLowPass=0; if(gainLowPass<0) gainLowPass=0;
if(gainLowPass>15) gainLowPass=15; if(gainLowPass>15) gainLowPass=15;
@@ -400,6 +401,21 @@ void Audio::setTone(int8_t gainLowPass, int8_t gainBandPass, int8_t gainHighPass
int8_t rtone[] = {(int8_t)map(gainHighPass, -16, 16, -8, 7), (int8_t)(2+gainBandPass), gainLowPass, (int8_t)(15-gainBandPass)}; int8_t rtone[] = {(int8_t)map(gainHighPass, -16, 16, -8, 7), (int8_t)(2+gainBandPass), gainLowPass, (int8_t)(15-gainBandPass)};
setTone(rtone); setTone(rtone);
} }
*/
void Audio::setTone(int8_t gainLowPass, int8_t gainBandPass, int8_t gainHighPass){
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){ void Audio::setBalance(int8_t bal){
m_balance = bal; m_balance = bal;
setVolume(curvol); setVolume(curvol);

View File

@@ -1,8 +1,8 @@
#ifndef COMMON_H #ifndef COMMON_H
#define COMMON_H #define COMMON_H
enum displayMode_e { PLAYER, VOL, STATIONS, NUMBERS, LOST, UPDATING, INFO, SETTINGS, TIMEZONE, WIFI, CLEAR, SLEEPING, SDCHANGE }; 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 }; 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 }; 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 struct requestParams_t

View File

@@ -33,6 +33,8 @@ bool Config::_isFSempty() {
void Config::init() { void Config::init() {
EEPROM.begin(EEPROM_SIZE); EEPROM.begin(EEPROM_SIZE);
sdResumePos = 0; sdResumePos = 0;
screensaverTicks = 0;
isScreensaver = false;
bootInfo(); bootInfo();
#if RTCSUPPORTED #if RTCSUPPORTED
_rtcFound = false; _rtcFound = false;
@@ -86,6 +88,10 @@ void Config::_setupVersion(){
uint16_t currentVersion = store.version; uint16_t currentVersion = store.version;
switch(currentVersion){ switch(currentVersion){
case 1: case 1:
saveValue(&store.screensaverEnabled, false);
saveValue(&store.screensaverTimeout, (uint16_t)20);
break;
case 2:
break; break;
default: default:
break; break;
@@ -339,6 +345,8 @@ void Config::setDefaults() {
store.forcemono = false; store.forcemono = false;
store.i2sinternal = false; store.i2sinternal = false;
store.rotate90 = false; store.rotate90 = false;
store.screensaverEnabled = false;
store.screensaverTimeout = 20;
eepromWrite(EEPROM_START, store); eepromWrite(EEPROM_START, store);
} }

View File

@@ -45,7 +45,7 @@
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0) #if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
#define ESP_ARDUINO_3 1 #define ESP_ARDUINO_3 1
#endif #endif
#define CONFIG_VERSION 1 #define CONFIG_VERSION 2
enum playMode_e : uint8_t { PM_WEB=0, PM_SDCARD=1 }; 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 }; enum BitrateFormat { BF_UNCNOWN, BF_MP3, BF_AAC, BF_FLAC, BF_OGG, BF_WAV };
@@ -133,6 +133,8 @@ struct config_t
bool forcemono; bool forcemono;
bool i2sinternal; bool i2sinternal;
bool rotate90; bool rotate90;
bool screensaverEnabled;
uint16_t screensaverTimeout;
}; };
#if IR_PIN!=255 #if IR_PIN!=255
@@ -175,6 +177,8 @@ class Config {
uint32_t sdResumePos; uint32_t sdResumePos;
bool emptyFS; bool emptyFS;
uint16_t vuThreshold; uint16_t vuThreshold;
uint16_t screensaverTicks;
bool isScreensaver;
public: public:
Config() {}; Config() {};
//void save(); //void save();

View File

@@ -252,6 +252,10 @@ void irLoop() {
if(config.ircodes.irVals[target][j]==irResults.value){ if(config.ircodes.irVals[target][j]==irResults.value){
if (network.status != CONNECTED && network.status!=SDREADY && target!=IR_AST) return; if (network.status != CONNECTED && network.status!=SDREADY && target!=IR_AST) return;
if(target!=IR_AST && display.mode()==LOST) return; if(target!=IR_AST && display.mode()==LOST) return;
if (display.mode() == SCREENSAVER) {
display.putRequest(NEWMODE, PLAYER);
return;
}
switch (target){ switch (target){
case IR_PLAY: { case IR_PLAY: {
irBlink(); irBlink();
@@ -483,6 +487,12 @@ void onBtnClick(int id) {
if (display.mode() == PLAYER) { if (display.mode() == PLAYER) {
player.toggle(); player.toggle();
} }
if (display.mode() == SCREENSAVER) {
display.putRequest(NEWMODE, PLAYER);
#ifdef DSP_LCD
delay(200);
#endif
}
if (display.mode() == STATIONS) { if (display.mode() == STATIONS) {
display.putRequest(NEWMODE, PLAYER); display.putRequest(NEWMODE, PLAYER);
#ifdef DSP_LCD #ifdef DSP_LCD
@@ -530,6 +540,10 @@ void onBtnClick(int id) {
} }
void onBtnDoubleClick(int id) { void onBtnDoubleClick(int id) {
if (display.mode() == SCREENSAVER) {
display.putRequest(NEWMODE, PLAYER);
return;
}
switch ((controlEvt_e)id) { switch ((controlEvt_e)id) {
case EVT_BTNLEFT: { case EVT_BTNLEFT: {
if (display.mode() != PLAYER) return; if (display.mode() != PLAYER) return;

View File

@@ -16,7 +16,7 @@ Nextion nextion;
//============================================================================================================================ //============================================================================================================================
DspCore dsp; DspCore dsp;
Page *pages[] = { new Page(), new Page(), new Page() }; Page *pages[] = { new Page(), new Page(), new Page(), new Page() };
#ifndef DSQ_SEND_DELAY #ifndef DSQ_SEND_DELAY
#define DSQ_SEND_DELAY portMAX_DELAY #define DSQ_SEND_DELAY portMAX_DELAY
@@ -153,6 +153,7 @@ void Display::_buildPager(){
#endif #endif
if(_vuwidget) pages[PG_PLAYER]->addWidget( _vuwidget); if(_vuwidget) pages[PG_PLAYER]->addWidget( _vuwidget);
pages[PG_PLAYER]->addWidget(&_clock); pages[PG_PLAYER]->addWidget(&_clock);
pages[PG_SCREENSAVER]->addWidget(&_clock);
pages[PG_PLAYER]->addPage(&_footer); pages[PG_PLAYER]->addPage(&_footer);
if(_metabackground) pages[PG_DIALOG]->addWidget( _metabackground); if(_metabackground) pages[PG_DIALOG]->addWidget( _metabackground);
@@ -267,6 +268,7 @@ void Display::_swichMode(displayMode_e newmode) {
_mode = newmode; _mode = newmode;
dsp.setScrollId(NULL); dsp.setScrollId(NULL);
if (newmode == PLAYER) { if (newmode == PLAYER) {
_clock.moveBack();
#ifdef DSP_LCD #ifdef DSP_LCD
dsp.clearDsp(); dsp.clearDsp();
#endif #endif
@@ -278,9 +280,17 @@ void Display::_swichMode(displayMode_e newmode) {
_meta.setAlign(metaConf.widget.align); _meta.setAlign(metaConf.widget.align);
_meta.setText(config.station.name); _meta.setText(config.station.name);
_nums.setText(""); _nums.setText("");
config.isScreensaver = false;
_pager.setPage( pages[PG_PLAYER]); _pager.setPage( pages[PG_PLAYER]);
pm.on_display_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) { if (newmode == VOL) {
#ifndef HIDE_IP #ifndef HIDE_IP
_showDialog(const_DlgVolume); _showDialog(const_DlgVolume);
@@ -377,7 +387,7 @@ void Display::loop() {
switch (request.type){ switch (request.type){
case NEWMODE: _swichMode((displayMode_e)request.payload); break; case NEWMODE: _swichMode((displayMode_e)request.payload); break;
case CLOCK: case CLOCK:
if(_mode==PLAYER) _time(); if(_mode==PLAYER || _mode==SCREENSAVER) _time();
/*#ifdef USE_NEXTION /*#ifdef USE_NEXTION
if(_mode==TIMEZONE) nextion.localTime(network.timeinfo); if(_mode==TIMEZONE) nextion.localTime(network.timeinfo);
if(_mode==INFO) nextion.rssi(); if(_mode==INFO) nextion.rssi();
@@ -522,6 +532,8 @@ void Display::_time(bool redraw) {
config.setBrightness(); config.setBrightness();
} }
#endif #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(); _clock.draw();
/*#ifdef USE_NEXTION /*#ifdef USE_NEXTION
nextion.printClock(network.timeinfo); nextion.printClock(network.timeinfo);

View File

@@ -294,7 +294,7 @@ void NetServer::processQueue(){
config.store.softapdelay, config.store.softapdelay,
config.vuThreshold); config.vuThreshold);
break; 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.flipscreen,
config.store.invertdisplay, config.store.invertdisplay,
config.store.numplaylist, config.store.numplaylist,
@@ -302,7 +302,9 @@ void NetServer::processQueue(){
config.store.dbgtouch, config.store.dbgtouch,
config.store.dspon, config.store.dspon,
config.store.brightness, config.store.brightness,
config.store.contrast); config.store.contrast,
config.store.screensaverEnabled,
config.store.screensaverTimeout);
break; break;
case GETTIMEZONE: sprintf (wsbuf, "{\"tzh\":%d,\"tzm\":%d,\"sntp1\":\"%s\",\"sntp2\":\"%s\"}", case GETTIMEZONE: sprintf (wsbuf, "{\"tzh\":%d,\"tzm\":%d,\"sntp1\":\"%s\",\"sntp2\":\"%s\"}",
config.store.tzHour, config.store.tzHour,
@@ -475,6 +477,23 @@ void NetServer::onWsMessage(void *arg, uint8_t *data, size_t len, uint8_t client
display.setContrast(); display.setContrast();
return; return;
} }
if (strcmp(cmd, "screensaverenabled") == 0) {
bool valb = static_cast<bool>(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) { if (strcmp(cmd, "tzh") == 0) {
int8_t vali = atoi(val); int8_t vali = atoi(val);
config.saveValue(&config.store.tzHour, vali); config.saveValue(&config.store.tzHour, vali);

View File

@@ -49,6 +49,11 @@ void ticks() {
network.forceWeather = true; 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 RTCSUPPORTED
if(config.isRTCFound()){ if(config.isRTCFound()){
rtc.getTime(&network.timeinfo); rtc.getTime(&network.timeinfo);

View File

@@ -1,7 +1,7 @@
#ifndef options_h #ifndef options_h
#define options_h #define options_h
#define YOVERSION "0.9.390" #define YOVERSION "0.9.399"
/******************************************************* /*******************************************************
DO NOT EDIT THIS FILE. DO NOT EDIT THIS FILE.
@@ -479,4 +479,7 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#define HOOPSENb 2 #define HOOPSENb 2
#endif #endif
#ifndef SCREENSAVERSTARTUPDELAY
#define SCREENSAVERSTARTUPDELAY 5
#endif
#endif #endif

View File

@@ -190,6 +190,7 @@ void Player::_play(uint16_t stationId) {
config.setDspOn(1); config.setDspOn(1);
config.vuThreshold = 0; config.vuThreshold = 0;
//display.putRequest(PSTOP); //display.putRequest(PSTOP);
config.screensaverTicks=SCREENSAVERSTARTUPDELAY;
if(config.getMode()!=PM_SDCARD) { if(config.getMode()!=PM_SDCARD) {
display.putRequest(PSTOP); display.putRequest(PSTOP);
} }
@@ -224,6 +225,7 @@ void Player::_play(uint16_t stationId) {
config.setSmartStart(1); config.setSmartStart(1);
netserver.requestOnChange(MODE, 0); netserver.requestOnChange(MODE, 0);
setOutputPins(true); setOutputPins(true);
display.putRequest(NEWMODE, PLAYER);
display.putRequest(PSTART); display.putRequest(PSTART);
if (player_on_start_play) player_on_start_play(); if (player_on_start_play) player_on_start_play();
pm.on_start_play(); pm.on_start_play();

View File

@@ -5,7 +5,7 @@
#include "display.h" #include "display.h"
#if defined(SD_SPIPINS) || SD_HSPI #if defined(SD_SPIPINS) || SD_HSPI
SPIClass SDSPI(HSPI); SPIClass SDSPI(HOOPSENb);
#define SDREALSPI SDSPI #define SDREALSPI SDSPI
#else #else
#define SDREALSPI SPI #define SDREALSPI SPI

View File

@@ -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 }; const BitrateConfig fullbitrateConf PROGMEM = {{DSP_WIDTH-TFT_FRAMEWDT-38, 59, 2, WA_LEFT}, 42 };
/* BANDS */ /* { onebandwidth, onebandheight, bandsHspace, bandsVspace, numofbands, fadespeed } */ /* 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 */ /* STRINGS */
const char numtxtFmt[] PROGMEM = "%d"; const char numtxtFmt[] PROGMEM = "%d";

View File

@@ -87,7 +87,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background); setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1); setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec); sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1); setTextSize(1);
setFont(&DS_DIGI42pt7b); setFont(&DS_DIGI42pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background); 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); dsp.fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background); setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10); setCursor(_dateleft, clockTop+10);
print(_dateBuf); /* print date */ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf)); strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth; _olddatewidth = _datewidth;
_olddateleft = _dateleft; _olddateleft = _dateleft;
@@ -130,8 +130,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf)); strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth; _oldtimewidth = _timewidth;
_oldtimeleft = _timeleft; _oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/ if(!config.isScreensaver) 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) 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); 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)); strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH; _datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -148,6 +148,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
_getTimeBounds(); _getTimeBounds();
clockRightSpace = (width()-_timewidth-CHARWIDTH*3*2-36)/2; clockRightSpace = (width()-_timewidth-CHARWIDTH*3*2-36)/2;
_clockTime(); _clockTime();
if(!config.isScreensaver)
/*if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) */_clockDate(); /*if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) */_clockDate();
} }
_clockSeconds(); _clockSeconds();

View File

@@ -149,7 +149,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background); setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*2*2, clockTop-clockTimeHeight+1); setCursor(width() - 8 - clockRightSpace - CHARWIDTH*2*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec); sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
} }
void DspCore::_clockDate(){ void DspCore::_clockDate(){
@@ -157,7 +157,7 @@ void DspCore::_clockDate(){
fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background); fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background); setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10); setCursor(_dateleft, clockTop+10);
print(_dateBuf); /* print date */ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf)); strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth; _olddatewidth = _datewidth;
_olddateleft = _dateleft; _olddateleft = _dateleft;
@@ -185,8 +185,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf)); strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth; _oldtimewidth = _timewidth;
_oldtimeleft = _timeleft; _oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*2*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/ if(!config.isScreensaver) 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) 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); 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)); strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH; _datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -201,6 +201,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){ if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds(); _getTimeBounds();
_clockTime(); _clockTime();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate(); if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
} }
_clockSeconds(); _clockSeconds();

View File

@@ -81,7 +81,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background); setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1); setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec); sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); if(!config.isScreensaver) print(_bufforseconds);
setTextSize(1); setTextSize(1);
setFont(&DS_DIGI42pt7b); setFont(&DS_DIGI42pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background); 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); dsp.fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background); setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10); setCursor(_dateleft, clockTop+10);
print(_dateBuf); /* print date */ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf)); strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth; _olddatewidth = _datewidth;
_olddateleft = _dateleft; _olddateleft = _dateleft;
@@ -123,8 +123,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf)); strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth; _oldtimewidth = _timewidth;
_oldtimeleft = _timeleft; _oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/ if(!config.isScreensaver) 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) 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); 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)); strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH; _datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -139,6 +139,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){ if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds(); _getTimeBounds();
_clockTime(); _clockTime();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate(); if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
} }
_clockSeconds(); _clockSeconds();

View File

@@ -88,7 +88,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background); setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*4*2, clockTop-clockTimeHeight+1); setCursor(width() - 8 - clockRightSpace - CHARWIDTH*4*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec); sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1); setTextSize(1);
setFont(&DS_DIGI56pt7b); setFont(&DS_DIGI56pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background); 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); setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+15); setCursor(_dateleft, clockTop+15);
setTextSize(2); setTextSize(2);
print(_dateBuf); /* print date */ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf)); strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth; _olddatewidth = _datewidth;
_olddateleft = _dateleft; _olddateleft = _dateleft;
@@ -131,8 +131,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf)); strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth; _oldtimewidth = _timewidth;
_oldtimeleft = _timeleft; _oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/ if(!config.isScreensaver) 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) 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); 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)); strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH*2; _datewidth = strlen(_dateBuf) * CHARWIDTH*2;
@@ -147,6 +147,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){ if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds(); _getTimeBounds();
_clockTime(); _clockTime();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate(); if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
} }
_clockSeconds(); _clockSeconds();

View File

@@ -166,7 +166,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
} }
void DspCore::clearClock(){ 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); //dsp.fillRect(_timeleft, clockTop-clockTimeHeight, _timewidth+CHARWIDTH*3*2+24, clockTimeHeight+10+CHARHEIGHT, config.theme.background);
} }

View File

@@ -146,7 +146,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
} }
void DspCore::clearClock(){ 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) { } void DspCore::startWrite(void) { }

View File

@@ -154,7 +154,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
} }
void DspCore::clearClock(){ 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) { } void DspCore::startWrite(void) { }

View File

@@ -165,7 +165,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
} }
void DspCore::clearClock(){ 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) { } void DspCore::startWrite(void) { }

View File

@@ -88,7 +88,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background); setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1); setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec); sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1); setTextSize(1);
setFont(&DS_DIGI42pt7b); setFont(&DS_DIGI42pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background); 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); dsp.fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background); setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10); setCursor(_dateleft, clockTop+10);
print(_dateBuf); /* print date */ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf)); strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth; _olddatewidth = _datewidth;
_olddateleft = _dateleft; _olddateleft = _dateleft;
@@ -130,8 +130,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf)); strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth; _oldtimewidth = _timewidth;
_oldtimeleft = _timeleft; _oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/ if(!config.isScreensaver) 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) 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); 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)); strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH; _datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -146,6 +146,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){ if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds(); _getTimeBounds();
_clockTime(); _clockTime();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate(); if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
} }
_clockSeconds(); _clockSeconds();

View File

@@ -87,7 +87,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background); setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*4*2, clockTop-clockTimeHeight+1); setCursor(width() - 8 - clockRightSpace - CHARWIDTH*4*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec); sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */ if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1); setTextSize(1);
setFont(&DS_DIGI56pt7b); setFont(&DS_DIGI56pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background); 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); setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+15); setCursor(_dateleft, clockTop+15);
setTextSize(2); setTextSize(2);
print(_dateBuf); /* print date */ if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf)); strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth; _olddatewidth = _datewidth;
_olddateleft = _dateleft; _olddateleft = _dateleft;
@@ -130,8 +130,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf)); strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth; _oldtimewidth = _timewidth;
_oldtimeleft = _timeleft; _oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/ if(!config.isScreensaver) 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) 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); 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)); strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH*2; _datewidth = strlen(_dateBuf) * CHARWIDTH*2;
@@ -146,6 +146,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){ if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds(); _getTimeBounds();
_clockTime(); _clockTime();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate(); if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
} }
_clockSeconds(); _clockSeconds();

View File

@@ -137,7 +137,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
} }
void DspCore::clearClock(){ 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) { } void DspCore::startWrite(void) { }