This commit is contained in:
e2002
2025-09-01 14:02:02 +03:00
parent 5d49b0849e
commit f82f4e38cf
15 changed files with 185 additions and 47 deletions

View File

@@ -235,6 +235,18 @@ Work is in progress...
--- ---
## Version history ## Version history
#### v0.9.700
- added support for **ST7789 320x170** displays \
`#define DSP_MODEL DSP_ST7789_170`
- added support for **LCD 20x2** displays (e.g. [WH2002A](https://aliexpress.com/item/32812259852.html))
`#define DSP_MODEL DSP_2002` or \
`#define DSP_MODEL DSP_2002I2C`
- added Russian language support for LCD displays that natively support Russian \
to enable, add `#define LCD_RUS` in **myoptions.h** \
PS: I cannot say in advance whether your LCD display supports Russian. \
PS2: the method of “Russification” for LCD displays without native Russian support (based on 8 custom characters) cannot be used, since 8 symbols are too few to display all the required information.
- bug fixes
#### v0.9.693 #### v0.9.693
- fixed incorrect behavior of the `HIDE_VU` setting [#205](https://github.com/e2002/yoradio/issues/205) - fixed incorrect behavior of the `HIDE_VU` setting [#205](https://github.com/e2002/yoradio/issues/205)
- fixed `CORRUPT HEAP` error when playing "invalid links" [#203](https://github.com/e2002/yoradio/issues/203) - fixed `CORRUPT HEAP` error when playing "invalid links" [#203](https://github.com/e2002/yoradio/issues/203)
@@ -278,7 +290,7 @@ Work is in progress...
- added support for ST7789 284x76 2.25' SPI displays https://aliexpress.ru/item/1005009016973081.html \ - added support for ST7789 284x76 2.25' SPI displays https://aliexpress.ru/item/1005009016973081.html \
note: the brightness pin of this display should be pulled up to GND note: the brightness pin of this display should be pulled up to GND
### v0.9.561 #### v0.9.561
**!!! a [full update](#update-over-web-interface) with Sketch data upload is required !!!**\ **!!! a [full update](#update-over-web-interface) with Sketch data upload is required !!!**\
or-> just upload `yoRadio/data/www/script.js.gz` to Webboard Uploader http://radioipaddr/webboard \ or-> just upload `yoRadio/data/www/script.js.gz` to Webboard Uploader http://radioipaddr/webboard \
After updating please clear browser cache. After updating please clear browser cache.
@@ -286,24 +298,24 @@ Work is in progress...
- fixed issue causing random reboots - fixed issue causing random reboots
- fixed preview playback bug in Playlist Editor - fixed preview playback bug in Playlist Editor
### v0.9.555 #### v0.9.555
- fixed error "assert failed: udp_new_ip_type /IDF/components/lwip/lwip/src/core/udp.c:1278 (Required to lock TCPIP core functionality!)"\ - fixed error "assert failed: udp_new_ip_type /IDF/components/lwip/lwip/src/core/udp.c:1278 (Required to lock TCPIP core functionality!)"\
part #2 part #2
- weather synchronization code rewritten - weather synchronization code rewritten
### v0.9.553 #### v0.9.553
- fix "No 'Access-Control-Allow-Origin' header is present on the requested resource" on saving playlist\ - fix "No 'Access-Control-Allow-Origin' header is present on the requested resource" on saving playlist\
just reupload the file `script.js.gz` with Webboard uploader just reupload the file `script.js.gz` with Webboard uploader
- fixed error "assert failed: udp_new_ip_type /IDF/components/lwip/lwip/src/core/udp.c:1278 (Required to lock TCPIP core functionality!)" - fixed error "assert failed: udp_new_ip_type /IDF/components/lwip/lwip/src/core/udp.c:1278 (Required to lock TCPIP core functionality!)"
- fixed error "Exception in status_listener when handling msg" in HA component - fixed error "Exception in status_listener when handling msg" in HA component
### v0.9.552 #### v0.9.552
- fixed compilation error for ESP cores version below 3.0.0\ - fixed compilation error for ESP cores version below 3.0.0\
Thanks to @salawalas ! https://github.com/e2002/yoradio/pull/197/ Thanks to @salawalas ! https://github.com/e2002/yoradio/pull/197/
- disabled websocket reconnection on all pages except the start page "/"\ - disabled websocket reconnection on all pages except the start page "/"\
just reupload the file `script.js.gz` just reupload the file `script.js.gz`
### v0.9.550 #### v0.9.550
**!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!**\ **!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!**\
or-> just upload all files from data/www (11 pcs) to Webboard Uploader http://radioipaddr/webboard or-> just upload all files from data/www (11 pcs) to Webboard Uploader http://radioipaddr/webboard
- fixed the issue with selecting all rows in the playlist editor - fixed the issue with selecting all rows in the playlist editor
@@ -320,12 +332,12 @@ or-> just upload all files from data/www (11 pcs) to Webboard Uploader http://ra
- settings for time and weather synchronization intervals have been added to the web interface - settings for time and weather synchronization intervals have been added to the web interface
- bug fixes, optimization - bug fixes, optimization
### v0.9.533 #### v0.9.533
- fixed compilation error for esp32 core version lower than 3.0.0 - fixed compilation error for esp32 core version lower than 3.0.0
- fixed error setting display brightness to 1 - fixed error setting display brightness to 1
- fixed error setting IR tolerance value (upload a new file `options.html.gz` via WEB Board Uploader and press Ctrl+F5 on the settings page) - fixed error setting IR tolerance value (upload a new file `options.html.gz` via WEB Board Uploader and press Ctrl+F5 on the settings page)
### v0.9.530 #### v0.9.530
- optimization of webserver/socket code in netserver.cpp, part#1 - optimization of webserver/socket code in netserver.cpp, part#1
- added support for ArduinoOTA (OTA update from Arduino IDE) (disabled by default)\ - added support for ArduinoOTA (OTA update from Arduino IDE) (disabled by default)\
to enable you need to add to myoptions.h: `#define USE_OTA true`\ to enable you need to add to myoptions.h: `#define USE_OTA true`\
@@ -338,13 +350,13 @@ or-> just upload all files from data/www (11 pcs) to Webboard Uploader http://ra
- added config (sys.config) telnet command that displays the same information usually shown over serial at boot. - added config (sys.config) telnet command that displays the same information usually shown over serial at boot.
- bug fixes 🪲 - bug fixes 🪲
### v0.9.515 #### v0.9.515
- fixed a bug with resetting all parameters when resetting only one section of parameters - fixed a bug with resetting all parameters when resetting only one section of parameters
### v0.9.512 #### v0.9.512
- fixed bug with saving ntp server #1 value - fixed bug with saving ntp server #1 value
### v0.9.511 #### v0.9.511
In this version, the contents of the data/www directory have changed, so that the first time you flash it, you will be greeted by WEB Board Uploader. Just upload all the files from data/www (11 pcs) to it\ In this version, the contents of the data/www directory have changed, so that the first time you flash it, you will be greeted by WEB Board Uploader. Just upload all the files from data/www (11 pcs) to it\
or -> **!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!** or -> **!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!**
- fixed a bug with saving smartstart mode - fixed a bug with saving smartstart mode
@@ -358,7 +370,7 @@ or -> **!!! a [full update](#update-over-web-interface) with Sketch data upload
- buttons reboot (reboot) format (spiffs format) and reset (reset settings to default) have been added to the settings - buttons reboot (reboot) format (spiffs format) and reset (reset settings to default) have been added to the settings
- the beginnings of theming (theme.css) (just a list of global colors that can be changed, and then uploaded to theme.css via WB uploader) - the beginnings of theming (theme.css) (just a list of global colors that can be changed, and then uploaded to theme.css via WB uploader)
### v0.9.434 #### v0.9.434
- fixed the issue with exiting Screensaver Blank Screen mode via button presses and IR commands. - fixed the issue with exiting Screensaver Blank Screen mode via button presses and IR commands.
- reduced the minimum frequency for tone control on I2S modules to 80Hz. - reduced the minimum frequency for tone control on I2S modules to 80Hz.
- increased the display update task delay to 10 TICKS. - increased the display update task delay to 10 TICKS.
@@ -366,13 +378,13 @@ or -> **!!! a [full update](#update-over-web-interface) with Sketch data upload
- when ENCODER2 is connected, the UP and DOWN buttons now work as PREV and NEXT (single click). - when ENCODER2 is connected, the UP and DOWN buttons now work as PREV and NEXT (single click).
- implemented backlight off in Screensaver Blank Screen mode. - implemented backlight off in Screensaver Blank Screen mode.
### v0.9.428 #### v0.9.428
- fixed freezing after SD scanning during playback - fixed freezing after SD scanning during playback
- AsyncWebSocket queue increased to 128 - AsyncWebSocket queue increased to 128
- fixed VU meter overlapping the clock on displays - fixed VU meter overlapping the clock on displays
- fixed Guru Meditation error when loading in SD mode with SD card removed - fixed Guru Meditation error when loading in SD mode with SD card removed
### v0.9.420 #### v0.9.420
**!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!** **!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!**
- added screensaver mode during playback, configurable via the web interface, pull request[#129](https://github.com/e2002/yoradio/pull/129) - added screensaver mode during playback, configurable via the web interface, pull request[#129](https://github.com/e2002/yoradio/pull/129)
- added blank screen mode to screensaver, configurable via the web interface, pull request[#129](https://github.com/e2002/yoradio/pull/129) - added blank screen mode to screensaver, configurable via the web interface, pull request[#129](https://github.com/e2002/yoradio/pull/129)
@@ -382,21 +394,21 @@ or -> **!!! a [full update](#update-over-web-interface) with Sketch data upload
`#define CONFIG_ASYNC_TCP_RUNNING_CORE 0` `#define CONFIG_ASYNC_TCP_RUNNING_CORE 0`
- bug fixes - bug fixes
### v0.9.412 #### v0.9.412
**!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!** **!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!**
- added mDNS support, configurable via the web interface, pull[#125](https://github.com/e2002/yoradio/pull/125) - added mDNS support, configurable via the web interface, pull[#125](https://github.com/e2002/yoradio/pull/125)
- added a setting that allows you to switch stations with the UP and DOWN buttons immediately, bypassing the playlist, configurable via the web interface, pull[#125](https://github.com/e2002/yoradio/pull/125) - added a setting that allows you to switch stations with the UP and DOWN buttons immediately, bypassing the playlist, configurable via the web interface, pull[#125](https://github.com/e2002/yoradio/pull/125)
### v0.9.399 #### v0.9.399
**!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!** **!!! 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. - added a screensaver mode, configurable via the web interface.
- changes to the tone control algorithm for the VS1053. - 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.
### v0.9.380 #### v0.9.380
- fixed compilation error for ESP32 cores >= 3.1.0 - fixed compilation error for ESP32 cores >= 3.1.0
- fixed freezing error with incorrectly configured RTC module - fixed freezing error with incorrectly configured RTC module
- [www|uart|telnet] new command `mode` - change SD/WEB mode. (0 - WEB, 1 - SD, 2 - Toggle) - [www|uart|telnet] new command `mode` - change SD/WEB mode. (0 - WEB, 1 - SD, 2 - Toggle)
@@ -405,7 +417,7 @@ or -> **!!! a [full update](#update-over-web-interface) with Sketch data upload
#### v0.9.375 #### v0.9.375
- fixed the issue with saving settings for TIMEZONE. - fixed the issue with saving settings for TIMEZONE.
### v0.9.373 #### v0.9.373
- fixed the issue with displaying the settings page on fresh ESP modules after saving the weather key - fixed the issue with displaying the settings page on fresh ESP modules after saving the weather key
(a [reset](https://github.com/e2002/yoradio/wiki/List-of-available-commands-(UART-telnet-GET-POST)) may be required) (a [reset](https://github.com/e2002/yoradio/wiki/List-of-available-commands-(UART-telnet-GET-POST)) may be required)

View File

@@ -73,7 +73,8 @@ DspCore dsp;
Page *pages[] = { new Page(), new Page(), new Page(), new Page() }; Page *pages[] = { new Page(), new Page(), new Page(), new Page() };
#if !((DSP_MODEL==DSP_ST7735 && DTYPE==INITR_BLACKTAB) || DSP_MODEL==DSP_ST7789 || DSP_MODEL==DSP_ST7796 || DSP_MODEL==DSP_ILI9488 || DSP_MODEL==DSP_ILI9486 || DSP_MODEL==DSP_ILI9341 || DSP_MODEL==DSP_ILI9225) #if !((DSP_MODEL==DSP_ST7735 && DTYPE==INITR_BLACKTAB) || DSP_MODEL==DSP_ST7789 || DSP_MODEL==DSP_ST7796 || DSP_MODEL==DSP_ILI9488 \
|| DSP_MODEL==DSP_ILI9486 || DSP_MODEL==DSP_ILI9341 || DSP_MODEL==DSP_ILI9225 || DSP_MODEL==DSP_ST7789_170)
#undef BITRATE_FULL #undef BITRATE_FULL
#define BITRATE_FULL false #define BITRATE_FULL false
#endif #endif

View File

@@ -2,7 +2,7 @@
#define options_h #define options_h
#pragma once #pragma once
#define YOVERSION "0.9.693" #define YOVERSION "0.9.700"
/******************************************************* /*******************************************************
DO NOT EDIT THIS FILE. DO NOT EDIT THIS FILE.
@@ -51,7 +51,10 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#define DSP_ILI9486 22 // (Testing mode) 480x320 3.5' https://aliexpress.com/item/1005001999296476.html?sku_id=12000018365356568 #define DSP_ILI9486 22 // (Testing mode) 480x320 3.5' https://aliexpress.com/item/1005001999296476.html?sku_id=12000018365356568
#define DSP_SSD1322 23 // 256x64 2.8' https://aliexpress.com/item/1005003480981568.html #define DSP_SSD1322 23 // 256x64 2.8' https://aliexpress.com/item/1005003480981568.html
#define DSP_ST7920 24 // 128x64 2.6' https://aliexpress.com/item/32699482638.html #define DSP_ST7920 24 // 128x64 2.6' https://aliexpress.com/item/32699482638.html
#define DSP_ST7789_76 25 // 284x76 2.25' https://aliexpress.ru/item/1005009016973081.html #define DSP_ST7789_76 25 // 284x76 2.25' https://aliexpress.com/item/1005009016973081.html
#define DSP_2002 26 // 20x2 https://aliexpress.com/item/32812259852.html
#define DSP_2002I2C 27 // 20x2 https://aliexpress.com/item/32812259852.html
#define DSP_ST7789_170 28 // 320x170 1.9' https://aliexpress.com/item/1005008723378017.html
#define DSP_CUSTOM 101 // your display #define DSP_CUSTOM 101 // your display
#ifndef DSP_MODEL #ifndef DSP_MODEL

View File

@@ -75,6 +75,7 @@ TimeKeeper::TimeKeeper(){
} }
bool TimeKeeper::loop0(){ // core0 (display) bool TimeKeeper::loop0(){ // core0 (display)
if (network.status != CONNECTED) return true;
uint32_t currentTime = millis(); uint32_t currentTime = millis();
static uint32_t _last1s = 0; static uint32_t _last1s = 0;
static uint32_t _last2s = 0; static uint32_t _last2s = 0;

View File

@@ -7,10 +7,13 @@
#ifndef displayLCD1602conf_h #ifndef displayLCD1602conf_h
#define displayLCD1602conf_h #define displayLCD1602conf_h
#if DSP_MODEL==DSP_2002 || DSP_MODEL==DSP_2002I2C
#define DSP_WIDTH 20
#else
#define DSP_WIDTH 16 #define DSP_WIDTH 16
#endif
#define TFT_FRAMEWDT 0 #define TFT_FRAMEWDT 0
#define MAX_WIDTH 16 #define MAX_WIDTH DSP_WIDTH
#define PLMITEMS 2 #define PLMITEMS 2
#define HIDE_IP #define HIDE_IP

View File

@@ -0,0 +1,77 @@
/*************************************************************************************
ST7789 320x240 displays configuration file.
Copy this file to yoRadio/src/displays/conf/displayST7789conf_custom.h
and modify it
More info on https://github.com/e2002/yoradio/wiki/Widgets#widgets-description
*************************************************************************************/
#ifndef displayST7789conf_h
#define displayST7789conf_h
#define DSP_WIDTH 320
#define DSP_HEIGHT 170
#define TFT_FRAMEWDT 6
#define MAX_WIDTH DSP_WIDTH-TFT_FRAMEWDT*2
//#define PLMITEMS 11
//#define PLMITEMLENGHT 40
//#define PLMITEMHEIGHT 22
#define HIDE_TITLE2
#define HIDE_DATE
#if BITRATE_FULL
#define TITLE_FIX 44
#else
#define TITLE_FIX 0
#endif
#define bootLogoTop 34
/* SROLLS */ /* {{ left, top, fontsize, align }, buffsize, uppercase, width, scrolldelay, scrolldelta, scrolltime } */
const ScrollConfig metaConf PROGMEM = {{ TFT_FRAMEWDT, TFT_FRAMEWDT, 3, WA_LEFT }, 140, true, MAX_WIDTH, 5000, 5, 30 };
const ScrollConfig title1Conf PROGMEM = {{ TFT_FRAMEWDT, 42, 2, WA_LEFT }, 140, true, MAX_WIDTH-TITLE_FIX, 5000, 4, 30 };
const ScrollConfig title2Conf PROGMEM = {{ TFT_FRAMEWDT, 72, 2, WA_LEFT }, 140, true, MAX_WIDTH-TITLE_FIX, 5000, 4, 30 };
const ScrollConfig playlistConf PROGMEM = {{ TFT_FRAMEWDT, 112, 2, WA_LEFT }, 140, true, MAX_WIDTH, 1000, 2, 30 };
const ScrollConfig apTitleConf PROGMEM = {{ TFT_FRAMEWDT, TFT_FRAMEWDT, 3, WA_CENTER }, 140, false, MAX_WIDTH, 0, 4, 20 };
const ScrollConfig apSettConf PROGMEM = {{ TFT_FRAMEWDT, DSP_HEIGHT-TFT_FRAMEWDT-16, 2, WA_LEFT }, 140, false, MAX_WIDTH, 0, 4, 30 };
const ScrollConfig weatherConf PROGMEM = {{ TFT_FRAMEWDT, 64, 2, WA_LEFT }, 140, true, MAX_WIDTH, 0, 4, 30 };
/* BACKGROUNDS */ /* {{ left, top, fontsize, align }, width, height, outlined } */
const FillConfig metaBGConf PROGMEM = {{ 0, 0, 0, WA_LEFT }, DSP_WIDTH, 34, false };
const FillConfig metaBGConfInv PROGMEM = {{ 0, 38, 0, WA_LEFT }, DSP_WIDTH, 1, false };
const FillConfig volbarConf PROGMEM = {{ TFT_FRAMEWDT, DSP_HEIGHT-TFT_FRAMEWDT-6, 0, WA_LEFT }, MAX_WIDTH, 6, true };
const FillConfig playlBGConf PROGMEM = {{ 0, 107, 0, WA_LEFT }, DSP_WIDTH, 24, false };
const FillConfig heapbarConf PROGMEM = {{ 0, DSP_HEIGHT-1, 0, WA_LEFT }, DSP_WIDTH, 1, false };
/* WIDGETS */ /* { left, top, fontsize, align } */
const WidgetConfig bootstrConf PROGMEM = { 0, 142, 1, WA_CENTER };
const WidgetConfig bitrateConf PROGMEM = { 70, 191, 1, WA_LEFT };
const WidgetConfig voltxtConf PROGMEM = { 0, DSP_HEIGHT-23, 1, WA_CENTER };
const WidgetConfig iptxtConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-23, 1, WA_LEFT };
const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-30, 2, WA_RIGHT };
const WidgetConfig numConf PROGMEM = { 0, 116, 0, WA_CENTER };
const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 46, 2, WA_CENTER };
const WidgetConfig apName2Conf PROGMEM = { TFT_FRAMEWDT, 70, 2, WA_CENTER };
const WidgetConfig apPassConf PROGMEM = { TFT_FRAMEWDT, 100, 2, WA_CENTER };
const WidgetConfig apPass2Conf PROGMEM = { TFT_FRAMEWDT, 124, 2, WA_CENTER };
const WidgetConfig clockConf PROGMEM = { TFT_FRAMEWDT*2, 139, 0, WA_RIGHT };
const WidgetConfig vuConf PROGMEM = { TFT_FRAMEWDT, 70, 1, WA_LEFT };
const WidgetConfig bootWdtConf PROGMEM = { 0, 122, 1, WA_CENTER };
const ProgressConfig bootPrgConf PROGMEM = { 90, 14, 4 };
const BitrateConfig fullbitrateConf PROGMEM = {{DSP_WIDTH-TFT_FRAMEWDT-40, 37, 2, WA_LEFT}, 42 };
/* BANDS */ /* { onebandwidth, onebandheight, bandsHspace, bandsVspace, numofbands, fadespeed } */
const VUBandsConfig bandsConf PROGMEM = { 24, 72, 4, 2, 8, 2 };
/* STRINGS */
const char numtxtFmt[] PROGMEM = "%d";
const char rssiFmt[] PROGMEM = "WiFi %d";
const char iptxtFmt[] PROGMEM = "\010 %s";
const char voltxtFmt[] PROGMEM = "\023\025%d";
const char bitrateFmt[] PROGMEM = "%d kBs";
/* MOVES */ /* { left, top, width } */
const MoveConfig clockMove PROGMEM = { TFT_FRAMEWDT, 139, 0 };
const MoveConfig weatherMove PROGMEM = { TFT_FRAMEWDT, 64, MAX_WIDTH-TITLE_FIX };
const MoveConfig weatherMoveVU PROGMEM = { 70, 64, MAX_WIDTH-70+TFT_FRAMEWDT-TITLE_FIX };
#endif

View File

@@ -1,5 +1,5 @@
#include "../core/options.h" #include "../core/options.h"
#if DSP_MODEL==DSP_1602I2C || DSP_MODEL==DSP_1602 || DSP_MODEL==DSP_2004 || DSP_MODEL==DSP_2004I2C #if DSP_MODEL==DSP_1602I2C || DSP_MODEL==DSP_1602 || DSP_MODEL==DSP_2004 || DSP_MODEL==DSP_2004I2C || DSP_MODEL==DSP_2002 || DSP_MODEL==DSP_2002I2C
#include "dspcore.h" #include "dspcore.h"
#include <WiFi.h> #include <WiFi.h>
#include "../core/config.h" #include "../core/config.h"
@@ -33,6 +33,8 @@ void DspCore::initDisplay() {
#else #else
#ifdef LCD_2004 #ifdef LCD_2004
begin(20, 4); begin(20, 4);
#elif DSP_MODEL==DSP_2002 || DSP_MODEL==DSP_2002I2C
begin(20, 2);
#else #else
begin(16, 2); begin(16, 2);
#endif #endif
@@ -50,7 +52,7 @@ void DspCore::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t colo
} }
uint16_t DspCore::width(){ uint16_t DspCore::width(){
#ifdef LCD_2004 #if defined(LCD_2004) || DSP_MODEL==DSP_2002 || DSP_MODEL==DSP_2002I2C
return 20; return 20;
#else #else
return 16; return 16;

View File

@@ -9,7 +9,11 @@
#define LCD_2004 #define LCD_2004
#endif #endif
#if DSP_MODEL==DSP_1602I2C || DSP_MODEL==DSP_2004I2C #if DSP_MODEL==DSP_2002 || DSP_MODEL==DSP_2002I2C
#define LCD_2002
#endif
#if DSP_MODEL==DSP_1602I2C || DSP_MODEL==DSP_2004I2C || DSP_MODEL==DSP_2002I2C
#define LCD_I2C #define LCD_I2C
#include "../LiquidCrystalI2C/LiquidCrystalI2CEx.h" #include "../LiquidCrystalI2C/LiquidCrystalI2CEx.h"
#else #else
@@ -18,8 +22,10 @@
#ifdef LCD_I2C #ifdef LCD_I2C
typedef LiquidCrystal_I2C yoDisplay; typedef LiquidCrystal_I2C yoDisplay;
#ifdef LCD_2004 #if defined(LCD_2004)
#define DSP_INIT LiquidCrystal_I2C(SCREEN_ADDRESS, 20, 4, I2C_SDA, I2C_SCL) #define DSP_INIT LiquidCrystal_I2C(SCREEN_ADDRESS, 20, 4, I2C_SDA, I2C_SCL)
#elif defined(LCD_2002)
#define DSP_INIT LiquidCrystal_I2C(SCREEN_ADDRESS, 20, 2, I2C_SDA, I2C_SCL)
#else #else
#define DSP_INIT LiquidCrystal_I2C(SCREEN_ADDRESS, 16, 2, I2C_SDA, I2C_SCL) #define DSP_INIT LiquidCrystal_I2C(SCREEN_ADDRESS, 16, 2, I2C_SDA, I2C_SCL)
#endif #endif

View File

@@ -1,5 +1,5 @@
#include "../core/options.h" #include "../core/options.h"
#if DSP_MODEL==DSP_ST7789 || DSP_MODEL==DSP_ST7789_240 || DSP_MODEL==DSP_ST7789_76 #if DSP_MODEL==DSP_ST7789 || DSP_MODEL==DSP_ST7789_240 || DSP_MODEL==DSP_ST7789_76 || DSP_MODEL==DSP_ST7789_170
#include "dspcore.h" #include "dspcore.h"
#include "../core/config.h" #include "../core/config.h"
@@ -16,6 +16,8 @@ DspCore::DspCore(): Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST) {}
void DspCore::initDisplay() { void DspCore::initDisplay() {
if(DSP_MODEL==DSP_ST7789_76){ if(DSP_MODEL==DSP_ST7789_76){
init(76,284); init(76,284);
}else if(DSP_MODEL==DSP_ST7789_170){
init(170,320);
}else{ }else{
init(240,(DSP_MODEL==DSP_ST7789)?320:240); init(240,(DSP_MODEL==DSP_ST7789)?320:240);
} }
@@ -30,7 +32,7 @@ void DspCore::initDisplay() {
void DspCore::clearDsp(bool black){ fillScreen(black?0:config.theme.background); } void DspCore::clearDsp(bool black){ fillScreen(black?0:config.theme.background); }
void DspCore::flip(){ void DspCore::flip(){
#if DSP_MODEL==DSP_ST7789 || DSP_MODEL==DSP_ST7789_76 #if DSP_MODEL==DSP_ST7789 || DSP_MODEL==DSP_ST7789_76 || DSP_MODEL==DSP_ST7789_170
setRotation(config.store.flipscreen?3:1); setRotation(config.store.flipscreen?3:1);
#endif #endif
#if DSP_MODEL==DSP_ST7789_240 #if DSP_MODEL==DSP_ST7789_240
@@ -41,7 +43,11 @@ void DspCore::flip(){
} }
#endif #endif
} }
void DspCore::invert(){ invertDisplay(config.store.invertdisplay); } void DspCore::invert(){ invertDisplay(
#if DSP_MODEL==DSP_ST7789_170
!
#endif
config.store.invertdisplay); }
void DspCore::sleep(void){ enableSleep(true); delay(150); enableDisplay(false); delay(150); } void DspCore::sleep(void){ enableSleep(true); delay(150); enableDisplay(false); delay(150); }
void DspCore::wake(void){ enableDisplay(true); delay(150); enableSleep(false); delay(150); } void DspCore::wake(void){ enableDisplay(true); delay(150); enableSleep(false); delay(150); }

View File

@@ -23,6 +23,8 @@ typedef Adafruit_ST7789 yoDisplay;
#else #else
#if DSP_MODEL==DSP_ST7789 #if DSP_MODEL==DSP_ST7789
#include "conf/displayST7789conf.h" #include "conf/displayST7789conf.h"
#elif DSP_MODEL==DSP_ST7789_170
#include "conf/displayST7789_170conf.h"
#elif DSP_MODEL==DSP_ST7789_76 #elif DSP_MODEL==DSP_ST7789_76
#include "conf/displayST7789_76conf.h" #include "conf/displayST7789_76conf.h"
#else #else

View File

@@ -26,7 +26,7 @@
#define DSP_OLED #define DSP_OLED
#include "displayN5110.h" #include "displayN5110.h"
#elif DSP_MODEL==DSP_ST7789 || DSP_MODEL==DSP_ST7789_240 // https://k210.org/images/content/uploads/yoradio/ST7789.jpg #elif DSP_MODEL==DSP_ST7789 || DSP_MODEL==DSP_ST7789_240 || DSP_MODEL==DSP_ST7789_170 // https://k210.org/images/content/uploads/yoradio/ST7789.jpg
#define TIME_SIZE 52 #define TIME_SIZE 52
#define PSFBUFFER #define PSFBUFFER
#include "displayST7789.h" #include "displayST7789.h"
@@ -41,7 +41,7 @@
#define DSP_OLED #define DSP_OLED
#include "displaySH1106.h" #include "displaySH1106.h"
#elif DSP_MODEL==DSP_1602I2C || DSP_MODEL==DSP_2004I2C || DSP_MODEL==DSP_1602 || DSP_MODEL==DSP_2004 #elif DSP_MODEL==DSP_1602I2C || DSP_MODEL==DSP_2004I2C || DSP_MODEL==DSP_1602 || DSP_MODEL==DSP_2004 || DSP_MODEL==DSP_2002 || DSP_MODEL==DSP_2002I2C
// https://k210.org/images/content/uploads/yoradio/DSP_1602.jpg // https://k210.org/images/content/uploads/yoradio/DSP_1602.jpg
// https://k210.org/images/content/uploads/yoradio/DSP_2004.jpg // https://k210.org/images/content/uploads/yoradio/DSP_2004.jpg
#define TIME_SIZE 1 #define TIME_SIZE 1

View File

@@ -192,7 +192,7 @@ const GFXglyph DS_DIGI42pt7bGlyphs[] PROGMEM = {
{ 1888, 6, 43, 15, 4, -42 } // 0x3A ':' { 1888, 6, 43, 15, 4, -42 } // 0x3A ':'
}; };
const GFXfont DS_DIGI42pt7b PROGMEM = { const GFXfont Clock_GFXfont PROGMEM = {
(uint8_t *)DS_DIGI42pt7bBitmaps, (uint8_t *)DS_DIGI42pt7bBitmaps,
(GFXglyph *)DS_DIGI42pt7bGlyphs, 0x20, 0x3A, 82 }; (GFXglyph *)DS_DIGI42pt7bGlyphs, 0x20, 0x3A, 82 };

View File

@@ -313,7 +313,7 @@ const GFXglyph DS_DIGI56pt7bGlyphs[] PROGMEM = {
{ 3320, 7, 59, 24, 8, -58 } // 0x3A ':' { 3320, 7, 59, 24, 8, -58 } // 0x3A ':'
}; };
const GFXfont DS_DIGI56pt7b PROGMEM = { const GFXfont Clock_GFXfont PROGMEM = {
(uint8_t *)DS_DIGI56pt7bBitmaps, (uint8_t *)DS_DIGI56pt7bBitmaps,
(GFXglyph *)DS_DIGI56pt7bGlyphs, 0x20, 0x3A, 110 }; (GFXglyph *)DS_DIGI56pt7bGlyphs, 0x20, 0x3A, 110 };

View File

@@ -23,57 +23,77 @@ size_t strlen_utf8(const char* s) {
char* utf8Rus(const char* str, bool uppercase) { char* utf8Rus(const char* str, bool uppercase) {
static char out[BUFLEN]; static char out[BUFLEN];
int outPos = 0; int outPos = 0;
#ifdef DSP_LCD #if defined(DSP_LCD) && !defined(LCD_RUS)
static const char* mapD0[] = { static const char* mapD0[] = {
"A","B","V","G","D","E","ZH","Z","I","Y", "A","B","V","G","D","E","ZH","Z","I","Y",
"K","L","M","N","O","P","R","S","T","U", "K","L","M","N","O","P","R","S","T","U",
"F","H","TS","CH","SH","SHCH","'","YU","'","E","YU","YA" "F","H","TS","CH","SH","SHCH","'","YU","'","E","YU","YA"
}; };
#endif
#if defined(DSP_LCD) && defined(LCD_RUS)
// except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё
static const unsigned char utf_recode[] PROGMEM =
{
0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,
0xa8,0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1,
0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f,
0xbe,0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0,0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7
};
#endif #endif
for (int i = 0; str[i] && outPos < BUFLEN - 1; i++) { for (int i = 0; str[i] && outPos < BUFLEN - 1; i++) {
uint8_t c = (uint8_t)str[i]; uint8_t c = (uint8_t)str[i];
if (c == 0xD0 && str[i+1]) { if (c == 0xD0 && str[i+1]) {
uint8_t n = (uint8_t)str[++i]; uint8_t n = (uint8_t)str[++i];
if (n == 0x81) { // Ё if (n == 0x81) { // Ё
#ifdef DSP_LCD #if defined(DSP_LCD) && !defined(LCD_RUS)
const char* t = "YO"; const char* t = "YO";
for (; *t && outPos < BUFLEN-1; t++) out[outPos++] = *t; for (; *t && outPos < BUFLEN-1; t++) out[outPos++] = *t;
#else #else
out[outPos++] = uppercase ? 0xA8 : 0xB8; out[outPos++] = uppercase ? 0xA8 : 0xB8;
#endif #endif
} else if (n >= 144 && n <= 191) { } else if (n >= 144 && n <= 191) {
#ifdef DSP_LCD #if defined(DSP_LCD) && !defined(LCD_RUS)
if(n>=176) n-=32; if(n>=176) n-=32;
const char* t = mapD0[n - 0x90]; const char* t = mapD0[n - 0x90];
for (; *t && outPos < BUFLEN-1; t++) out[outPos++] = *t; for (; *t && outPos < BUFLEN-1; t++) out[outPos++] = *t;
#else
#if defined(DSP_LCD) && defined(LCD_RUS)
if(n>=176) n-=32;
out[outPos++] = utf_recode[n - 0x90];
#else #else
uint8_t ch = n + 48; uint8_t ch = n + 48;
if(n>=176 && uppercase) ch-=32; if(n>=176 && uppercase) ch-=32;
out[outPos++] = ch; out[outPos++] = ch;
#endif #endif
#endif
} }
} else if (c == 0xD1 && str[i+1]) { } else if (c == 0xD1 && str[i+1]) {
uint8_t n = (uint8_t)str[++i]; uint8_t n = (uint8_t)str[++i];
if (n == 0x91) { // ё if (n == 0x91) { // ё
#ifdef DSP_LCD #if defined(DSP_LCD) && !defined(LCD_RUS)
const char* t = "YO"; const char* t = "YO";
for (; *t && outPos < BUFLEN-1; t++) out[outPos++] = *t; for (; *t && outPos < BUFLEN-1; t++) out[outPos++] = *t;
#else #else
out[outPos++] = uppercase ? 0xA8 : 0xB8; out[outPos++] = uppercase ? 0xA8 : 0xB8;
#endif #endif
} else if (n >= 128 && n <= 143) { } else if (n >= 128 && n <= 143) {
#ifdef DSP_LCD #if defined(DSP_LCD) && !defined(LCD_RUS)
n+=16; n+=16;
const char* t = mapD0[n - 128]; const char* t = mapD0[n - 128];
for (; *t && outPos < BUFLEN-1; t++) out[outPos++] = *t; for (; *t && outPos < BUFLEN-1; t++) out[outPos++] = *t;
#else
#if defined(DSP_LCD) && defined(LCD_RUS)
n+=16;
out[outPos++] = utf_recode[n - 128];
#else #else
uint8_t ch = n + 112; uint8_t ch = n + 112;
if(uppercase) ch-=32; if(uppercase) ch-=32;
out[outPos++] = ch; out[outPos++] = ch;
#endif #endif
#endif
} }
} else { // ASCII } else { // ASCII
#ifdef DSP_LCD #if defined(DSP_LCD) && !defined(LCD_RUS)
char ch = (char)toupper(c); char ch = (char)toupper(c);
if (ch == 7) ch = (char)165; if (ch == 7) ch = (char)165;
if (ch == 9) ch = (char)223; if (ch == 9) ch = (char)223;

View File

@@ -601,12 +601,16 @@ void ClockWidget::init(WidgetConfig wconf, uint16_t fgcolor, uint16_t bgcolor){
else if(TIME_SIZE==19 || TIME_SIZE==2) _superfont=1; else if(TIME_SIZE==19 || TIME_SIZE==2) _superfont=1;
else _superfont=0; else _superfont=0;
_space = (5*_superfont)/2; //magick _space = (5*_superfont)/2; //magick
#ifndef HIDE_DATE
if(_fullclock){ if(_fullclock){
_dateheight = _superfont<4?1:2; _dateheight = _superfont<4?1:2;
_clockheight = _timeheight + _space + CHARHEIGHT * _dateheight; _clockheight = _timeheight + _space + CHARHEIGHT * _dateheight;
} else { } else {
_clockheight = _timeheight; _clockheight = _timeheight;
} }
#else
_clockheight = _timeheight;
#endif
_getTimeBounds(); _getTimeBounds();
#ifdef PSFBUFFER #ifdef PSFBUFFER
_fb = new psFrameBuffer(dsp.width(), dsp.height()); _fb = new psFrameBuffer(dsp.width(), dsp.height());
@@ -706,6 +710,7 @@ void ClockWidget::_printClock(bool force){
gfx.setTextColor(config.theme.dow, config.theme.background); gfx.setTextColor(config.theme.dow, config.theme.background);
gfx.print(utf8Rus(LANG::dow[network.timeinfo.tm_wday], false)); gfx.print(utf8Rus(LANG::dow[network.timeinfo.tm_wday], false));
sprintf(_tmp, "%2d %s %d", network.timeinfo.tm_mday,LANG::mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900); sprintf(_tmp, "%2d %s %d", network.timeinfo.tm_mday,LANG::mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
#ifndef HIDE_DATE
strlcpy(_datebuf, utf8Rus(_tmp, true), sizeof(_datebuf)); strlcpy(_datebuf, utf8Rus(_tmp, true), sizeof(_datebuf));
uint16_t _datewidth = strlen(_datebuf) * CHARWIDTH*_dateheight; uint16_t _datewidth = strlen(_datebuf) * CHARWIDTH*_dateheight;
gfx.setTextSize(_dateheight); gfx.setTextSize(_dateheight);
@@ -716,6 +721,7 @@ void ClockWidget::_printClock(bool force){
#endif #endif
gfx.setTextColor(config.theme.date, config.theme.background); gfx.setTextColor(config.theme.date, config.theme.background);
gfx.print(_datebuf); gfx.print(_datebuf);
#endif
} }
} }
} }
@@ -949,7 +955,6 @@ void PlayListWidget::_printPLitem(uint8_t pos, const char* item){
dsp.setTextColor(config.theme.playlist[plColor], config.theme.background); dsp.setTextColor(config.theme.playlist[plColor], config.theme.background);
dsp.setCursor(TFT_FRAMEWDT, _plYStart + pos * _plItemHeight); dsp.setCursor(TFT_FRAMEWDT, _plYStart + pos * _plItemHeight);
dsp.fillRect(0, _plYStart + pos * _plItemHeight - 1, dsp.width(), _plItemHeight - 2, config.theme.background); dsp.fillRect(0, _plYStart + pos * _plItemHeight - 1, dsp.width(), _plItemHeight - 2, config.theme.background);
Serial.println(item);
dsp.print(utf8Rus(item, true)); dsp.print(utf8Rus(item, true));
} }
} }