diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6012bb07f0..434aa80634 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ name: Build on: push: branches: [mega] - tags-ignore: '**' + tags-ignore: ['**'] paths-ignore: - 'dist/Release_notes.txt' - 'docs/**' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8a70cdf92..9cb7bb9d4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,8 @@ name: Release on: push: - branches-ignore: '**' - tags: 'mega-*' + branches-ignore: ['**'] + tags: ['mega-*'] permissions: contents: read diff --git a/docs/source/Plugin/P104-Font-Cyrillic-ext.rst b/docs/source/Plugin/P104-Font-Cyrillic-ext.rst new file mode 100644 index 0000000000..9a3e6b01c7 --- /dev/null +++ b/docs/source/Plugin/P104-Font-Cyrillic-ext.rst @@ -0,0 +1,9 @@ +.. include:: ../Plugin/_plugin_substitutions_p10x.repl +.. _P104-Font-Cyrillic-ext_page: + +|P104-Font-Cyrillic-ext_typename| +====================================================== + +A set of Cyrillic characters, as an extension to the regular ASCII characters, numerics and punctuation. + +.. image:: P104_Font_Cyrillic-ext.png \ No newline at end of file diff --git a/docs/source/Plugin/P104.rst b/docs/source/Plugin/P104.rst index d4e36df2dc..65e44d36fd 100644 --- a/docs/source/Plugin/P104.rst +++ b/docs/source/Plugin/P104.rst @@ -227,9 +227,9 @@ Available options: .. image:: P104_ZoneFontOptions.png :alt: Zone font options -All available fonts have been taken from the example code of the used Parola library. +Most available fonts have been taken from the example code of the used Parola library, and the Cyrillic font from a post in the arduino.ru forum. -The Arabic, Greek and Katakana fonts have all their characters in the 'high-ascii' range (> 128 ascii values), so they can (and should) **not** be used to 'translate' normal text to Arabic, Greek or Katakana. +The Arabic, Greek, Katakana and Cyrillic fonts have all their characters in the 'high-ascii' range (> 128 ascii values), so they can (and should) **not** be used to 'translate' normal text to Arabic, Greek or Katakana. On 'bin-size-challenged' builds the *Full, double height* font is replaced by the *Numeric, double height* font, to limit the bin-size a bit more. This font can display only numeric (actually hexadecimal, 0..9 and A..F) and date/time content. @@ -244,6 +244,7 @@ Font overview: * :ref:`P104-Font-Arabic_page` * :ref:`P104-Font-Greek_page` * :ref:`P104-Font-Katakana_page` +* :ref:`P104-Font-Cyrillic-ext_page` .. spacer diff --git a/docs/source/Plugin/P104_Font_Cyrillic-ext.png b/docs/source/Plugin/P104_Font_Cyrillic-ext.png new file mode 100644 index 0000000000..d8b80c9009 Binary files /dev/null and b/docs/source/Plugin/P104_Font_Cyrillic-ext.png differ diff --git a/docs/source/Plugin/P104_ZoneFontOptions.png b/docs/source/Plugin/P104_ZoneFontOptions.png index 037682e93f..d344d19c70 100644 Binary files a/docs/source/Plugin/P104_ZoneFontOptions.png and b/docs/source/Plugin/P104_ZoneFontOptions.png differ diff --git a/docs/source/Plugin/_plugin_substitutions_p10x.repl b/docs/source/Plugin/_plugin_substitutions_p10x.repl index 9a282e3751..19afeb6386 100644 --- a/docs/source/Plugin/_plugin_substitutions_p10x.repl +++ b/docs/source/Plugin/_plugin_substitutions_p10x.repl @@ -73,6 +73,7 @@ .. |P104-Font-Arabic_typename| replace:: `Arabic font characters` .. |P104-Font-Greek_typename| replace:: `Greek font characters` .. |P104-Font-Katakana_typename| replace:: `Katakana font characters` +.. |P104-Font-Cyrillic-ext_typename| replace:: `Cyrillic ext. font characters` .. |P105_name| replace:: :cyan:`AHT1x/AHT2x/DHT20/AM2301B` diff --git a/docs/source/Plugin/_plugin_substitutions_p16x.repl b/docs/source/Plugin/_plugin_substitutions_p16x.repl index 4c533a76ec..87538a280d 100644 --- a/docs/source/Plugin/_plugin_substitutions_p16x.repl +++ b/docs/source/Plugin/_plugin_substitutions_p16x.repl @@ -67,7 +67,7 @@ .. |P167_type| replace:: :cyan:`Environment` .. |P167_typename| replace:: :cyan:`Environment - Sensirion SEN5x (IKEA Vindstyrka)` .. |P167_porttype| replace:: `.` -.. |P167_status| replace:: :yellow:`CLIMATE B` +.. |P167_status| replace:: :yellow:`CLIMATE A` .. |P167_github| replace:: P167_Vindstyrka.ino .. _P167_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P167_Vindstyrka.ino .. |P167_usedby| replace:: `.` diff --git a/docs/source/conf.py b/docs/source/conf.py index 96817160cc..09eac6e2ec 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,7 +15,7 @@ # import os # import sys # sys.path.insert(0, os.path.abspath('.')) -from recommonmark.parser import CommonMarkParser +# from recommonmark.parser import CommonMarkParser import sphinx_bootstrap_theme # -- Project information ----------------------------------------------------- @@ -52,15 +52,15 @@ # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] -source_parsers = { - '.md': CommonMarkParser, -} +# source_parsers = { +# '.md': CommonMarkParser, +# } # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # -source_suffix = ['.rst', '.md'] -#source_suffix = '.rst' +# source_suffix = ['.rst', '.md'] +source_suffix = {'.rst': 'restructuredtext'} # The master toctree document. master_doc = 'index' diff --git a/docs/source/index.rst b/docs/source/index.rst index 7adfb7c4ea..87fdba648d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -56,6 +56,7 @@ Welcome to ESP Easy's documentation! Controller/C* Notify/N* Plugin/P* + Network/NW* Rules/HTTPResponseParser.rst diff --git a/src/_P037_MQTTImport.ino b/src/_P037_MQTTImport.ino index c5687b4dbc..44f158a5a4 100644 --- a/src/_P037_MQTTImport.ino +++ b/src/_P037_MQTTImport.ino @@ -569,7 +569,7 @@ boolean Plugin_037(uint8_t function, struct EventStruct *event, String& string) # if !defined(P037_LIMIT_BUILD_SIZE) || defined(P037_OVERRIDE) if (loglevelActiveFor(LOG_LEVEL_INFO)) { - String log = strformat(F("IMPT : MQTT fetched json attribute: %s payload: "), + String log = strformat(F("IMPT : MQTT fetched json attribute: %s payload: %s"), key.c_str(), Payload.c_str()); diff --git a/src/_P104_max7219_Dotmatrix.ino b/src/_P104_max7219_Dotmatrix.ino index 3bc461e113..580b3f793f 100644 --- a/src/_P104_max7219_Dotmatrix.ino +++ b/src/_P104_max7219_Dotmatrix.ino @@ -73,7 +73,9 @@ // the coordinate set. // -/** History: +/** History/Changelog: + * 2026-02-04 tonhuisman: Add ASCII font with Cyrillic extension characters + * Reformat sources with updated Uncrustify settings, use block-comment for History/Changelog * 2025-08-12 tonhuisman: Enable use of secondary SPI bus * 2025-04-03 tonhuisman: Set character spacing correctly when changing fonts * 2023-10-15 tonhuisman: Code improvements, now using NR_ELEMENTS macro instead of multiple #ifdefs and increments @@ -135,12 +137,13 @@ # include "src/PluginStructs/P104_data_struct.h" - boolean Plugin_104(uint8_t function, struct EventStruct *event, String& string) { boolean success = false; - switch (function) { - case PLUGIN_DEVICE_ADD: { + switch (function) + { + case PLUGIN_DEVICE_ADD: + { auto& dev = Device[++deviceCount]; dev.Number = PLUGIN_ID_104; dev.Type = DEVICE_TYPE_SPI; @@ -150,23 +153,27 @@ boolean Plugin_104(uint8_t function, struct EventStruct *event, String& string) break; } - case PLUGIN_SET_DEFAULTS: { + case PLUGIN_SET_DEFAULTS: + { CONFIG_PORT = -1; P104_CONFIG_HARDWARETYPE = static_cast(MD_MAX72XX::moduleType_t::FC16_HW); break; } - case PLUGIN_GET_DEVICENAME: { + case PLUGIN_GET_DEVICENAME: + { string = F(PLUGIN_NAME_104); break; } - case PLUGIN_GET_DEVICEGPIONAMES: { + case PLUGIN_GET_DEVICEGPIONAMES: + { event->String1 = formatGpioName_output(F("CS")); break; } - case PLUGIN_WEBFORM_LOAD: { + case PLUGIN_WEBFORM_LOAD: + { int8_t spi_pins[3]; Settings.getSPI_pins(spi_pins); int pinnr = -1; @@ -217,7 +224,8 @@ boolean Plugin_104(uint8_t function, struct EventStruct *event, String& string) break; } - case PLUGIN_WEBFORM_SAVE: { + case PLUGIN_WEBFORM_SAVE: + { P104_data_struct *P104_data = static_cast(getPluginTaskData(event->TaskIndex)); P104_CONFIG_ZONE_COUNT = getFormItemInt(F("zonecount")); @@ -248,7 +256,8 @@ boolean Plugin_104(uint8_t function, struct EventStruct *event, String& string) break; } - case PLUGIN_INIT: { + case PLUGIN_INIT: + { uint8_t numDevices = P104_CONFIG_TOTAL_UNITS; if (numDevices == 0) { // fallback value @@ -287,7 +296,8 @@ boolean Plugin_104(uint8_t function, struct EventStruct *event, String& string) break; } - case PLUGIN_EXIT: { + case PLUGIN_EXIT: + { P104_data_struct *P104_data = static_cast(getPluginTaskData(event->TaskIndex)); if ((nullptr == P104_data) || (nullptr == P104_data->P)) { @@ -302,7 +312,8 @@ boolean Plugin_104(uint8_t function, struct EventStruct *event, String& string) break; } - case PLUGIN_WRITE: { + case PLUGIN_WRITE: + { P104_data_struct *P104_data = static_cast(getPluginTaskData(event->TaskIndex)); if (nullptr != P104_data) { @@ -312,7 +323,8 @@ boolean Plugin_104(uint8_t function, struct EventStruct *event, String& string) break; } - case PLUGIN_TEN_PER_SECOND: { + case PLUGIN_TEN_PER_SECOND: + { P104_data_struct *P104_data = static_cast(getPluginTaskData(event->TaskIndex)); if ((nullptr != P104_data) && (nullptr != P104_data->P)) { @@ -323,7 +335,8 @@ boolean Plugin_104(uint8_t function, struct EventStruct *event, String& string) break; } - case PLUGIN_ONCE_A_SECOND: { + case PLUGIN_ONCE_A_SECOND: + { P104_data_struct *P104_data = static_cast(getPluginTaskData(event->TaskIndex)); if ((nullptr != P104_data) && (nullptr != P104_data->P)) { diff --git a/src/src/PluginStructs/P104_data_struct.cpp b/src/src/PluginStructs/P104_data_struct.cpp index c7ee59160a..c577376c65 100644 --- a/src/src/PluginStructs/P104_data_struct.cpp +++ b/src/src/PluginStructs/P104_data_struct.cpp @@ -123,6 +123,7 @@ bool P104_data_struct::begin() { - ... - Max. allowed total custom settings size = 4096 */ + /************************************** * loadSettings *************************************/ @@ -343,57 +344,73 @@ void P104_data_struct::configureZones() { P->setCharSpacing(currentZone, P104_NORMAL_CHAR_SPACING); // Set default font spacing - switch (it->font) { + switch (it->font) + { # ifdef P104_USE_NUMERIC_DOUBLEHEIGHT_FONT - case P104_DOUBLE_HEIGHT_FONT_ID: { + case P104_DOUBLE_HEIGHT_FONT_ID: + { P->setFont(currentZone, numeric7SegDouble); P->setCharSpacing(currentZone, P104_DOUBLE_CHAR_SPACING); // double spacing as well break; } # endif // ifdef P104_USE_NUMERIC_DOUBLEHEIGHT_FONT # ifdef P104_USE_FULL_DOUBLEHEIGHT_FONT - case P104_FULL_DOUBLEHEIGHT_FONT_ID: { + case P104_FULL_DOUBLEHEIGHT_FONT_ID: + { P->setFont(currentZone, BigFont); P->setCharSpacing(currentZone, P104_DOUBLE_CHAR_SPACING); // double spacing as well break; } # endif // ifdef P104_USE_FULL_DOUBLEHEIGHT_FONT # ifdef P104_USE_VERTICAL_FONT - case P104_VERTICAL_FONT_ID: { + case P104_VERTICAL_FONT_ID: + { P->setFont(currentZone, _fontVertical); break; } # endif // ifdef P104_USE_VERTICAL_FONT # ifdef P104_USE_EXT_ASCII_FONT - case P104_EXT_ASCII_FONT_ID: { + case P104_EXT_ASCII_FONT_ID: + { P->setFont(currentZone, ExtASCII); break; } # endif // ifdef P104_USE_EXT_ASCII_FONT # ifdef P104_USE_ARABIC_FONT - case P104_ARABIC_FONT_ID: { + case P104_ARABIC_FONT_ID: + { P->setFont(currentZone, fontArabic); break; } # endif // ifdef P104_USE_ARABIC_FONT # ifdef P104_USE_GREEK_FONT - case P104_GREEK_FONT_ID: { + case P104_GREEK_FONT_ID: + { P->setFont(currentZone, fontGreek); break; } # endif // ifdef P104_USE_GREEK_FONT # ifdef P104_USE_KATAKANA_FONT - case P104_KATAKANA_FONT_ID: { + case P104_KATAKANA_FONT_ID: + { P->setFont(currentZone, fontKatakana); break; } # endif // ifdef P104_USE_KATAKANA_FONT + # ifdef P104_USE_CYRILLIC_EXT_FONT + case P104_CYRILLIC_EXT_FONT_ID: + { + P->setFont(currentZone, font_cyr_ext); + break; + } + # endif // ifdef P104_USE_CYRILLIC_EXT_FONT // Extend above this comment with more fonts if/when available, // case P104_DEFAULT_FONT_ID: and default: clauses should be the last options. // This should also make sure the default font is set if a no longer available font was selected case P104_DEFAULT_FONT_ID: - default: { + default: + { P->setFont(currentZone, nullptr); // default font break; } @@ -795,6 +812,7 @@ void P104_data_struct::displayBarGraph(uint8_t zone, # endif // ifdef P104_USE_BAR_GRAPH # ifdef P104_USE_DOT_SET + void P104_data_struct::displayDots(uint8_t zone, const P104_zone_struct& zstruct, const String & dots) { @@ -847,7 +865,8 @@ void P104_data_struct::displayDots(uint8_t zone, bool isAnimationAvailable(uint8_t animation, bool noneIsAllowed = false) { textEffect_t selection = static_cast(animation); - switch (selection) { + switch (selection) + { case PA_NO_EFFECT: { return noneIsAllowed; @@ -994,6 +1013,7 @@ enum class p104_subcommands_e { specialeffect, // subcommand: specialeffect,, (0..3) speed, // subcommand: speed,, (0..P104_MAX_SPEED_PAUSE_VALUE) # endif // ifdef P104_USE_COMMANDS + }; /******************************************************* @@ -1044,7 +1064,8 @@ bool P104_data_struct::handlePluginWrite(taskIndex_t taskIndex, // subcommands are processed in the same order as they are presented in the UI for (auto it = zones.begin(); it != zones.end() && !success; ++it) { if ((it->zone == zoneIndex)) { // This zone - switch (subcommands_e) { + switch (subcommands_e) + { case p104_subcommands_e::clear: // subcommand: clear, { @@ -1192,6 +1213,9 @@ bool P104_data_struct::handlePluginWrite(taskIndex_t taskIndex, # ifdef P104_USE_KATAKANA_FONT || (value4 == P104_KATAKANA_FONT_ID) # endif // ifdef P104_USE_KATAKANA_FONT + # ifdef P104_USE_CYRILLIC_EXT_FONT + || (value4 == P104_CYRILLIC_EXT_FONT_ID) + # endif // ifdef P104_USE_CYRILLIC_EXT_FONT ) { reconfigure = (it->font != value4); @@ -1413,7 +1437,8 @@ void P104_data_struct::getDate(char *psz, # ifdef P104_USE_DATETIME_OPTIONS if (showYear) { - switch (dateFmt) { + switch (dateFmt) + { case P104_DATE_FORMAT_US: d = node_time.month(); m = node_time.day(); @@ -1480,7 +1505,8 @@ uint8_t P104_data_struct::getDateTime(char *psz, # ifdef P104_USE_DATETIME_OPTIONS - switch (dateFmt) { + switch (dateFmt) + { case P104_DATE_FORMAT_US: d = node_time.month(); m = node_time.day(); @@ -1506,6 +1532,7 @@ uint8_t P104_data_struct::getDateTime(char *psz, } # if defined(P104_USE_NUMERIC_DOUBLEHEIGHT_FONT) || defined(P104_USE_FULL_DOUBLEHEIGHT_FONT) + void P104_data_struct::createHString(String& string) { const uint16_t stringLen = string.length(); @@ -1551,7 +1578,8 @@ bool P104_data_struct::handlePluginOncePerSecond(struct EventStruct *event) { redisplay = false; if (P->getZoneStatus(it->zone - 1)) { // Animations done? - switch (it->content) { + switch (it->content) + { case P104_CONTENT_TIME: // time case P104_CONTENT_TIME_SEC: // time sec { @@ -1988,10 +2016,7 @@ bool P104_data_struct::webform_load(struct EventStruct *event) { }; const int orderOptions[] = { 0, 1 }; FormSelectorOptions selector_zoneordering(2, orderTypes, orderOptions); - selector.reloadonchange = true; - # ifdef P104_USE_TOOLTIPS - selector.tooltip = zonetip; - # endif // ifdef P104_USE_TOOLTIPS + selector_zoneordering.reloadonchange = true; selector_zoneordering.addFormSelector(F("Zone order"), F("zoneorder"), bitRead(P104_CONFIG_FLAGS, P104_CONFIG_FLAG_ZONE_ORDER) ? 1 : 0); selector_zoneordering.reloadonchange = true; @@ -2137,6 +2162,9 @@ bool P104_data_struct::webform_load(struct EventStruct *event) { # ifdef P104_USE_KATAKANA_FONT , F("Katakana (7)") # endif // ifdef P104_USE_KATAKANA_FONT + # ifdef P104_USE_CYRILLIC_EXT_FONT + , F("Cyrillic ext. (8)") + # endif // ifdef P104_USE_CYRILLIC_EXT_FONT }; const int fontOptions[] = { P104_DEFAULT_FONT_ID @@ -2161,6 +2189,9 @@ bool P104_data_struct::webform_load(struct EventStruct *event) { # ifdef P104_USE_KATAKANA_FONT , P104_KATAKANA_FONT_ID # endif // ifdef P104_USE_KATAKANA_FONT + # ifdef P104_USE_CYRILLIC_EXT_FONT + , P104_CYRILLIC_EXT_FONT_ID + # endif // ifdef P104_USE_CYRILLIC_EXT_FONT }; constexpr int fontCount = NR_ELEMENTS(fontTypes); @@ -2564,25 +2595,39 @@ bool P104_data_struct::webform_save(struct EventStruct *event) { P104_zone_struct::P104_zone_struct(uint8_t _zone) : text(F("\"\"")), zone(_zone) {} - bool P104_zone_struct::getIntValue(uint8_t offset, int32_t& value) const { - switch (offset) { - case P104_OFFSET_SIZE: value = size; break; + switch (offset) + { + case P104_OFFSET_SIZE: value = size; + break; case P104_OFFSET_TEXT: return false; - case P104_OFFSET_CONTENT: value = content; break; - case P104_OFFSET_ALIGNMENT: value = alignment; break; - case P104_OFFSET_ANIM_IN: value = animationIn; break; - case P104_OFFSET_SPEED: value = speed; break; - case P104_OFFSET_ANIM_OUT: value = animationOut; break; - case P104_OFFSET_PAUSE: value = pause; break; - case P104_OFFSET_FONT: value = font; break; - case P104_OFFSET_LAYOUT: value = layout; break; - case P104_OFFSET_SPEC_EFFECT: value = specialEffect; break; - case P104_OFFSET_OFFSET: value = offset; break; - case P104_OFFSET_BRIGHTNESS: value = brightness; break; - case P104_OFFSET_REPEATDELAY: value = repeatDelay; break; - case P104_OFFSET_INVERTED: value = inverted; break; + case P104_OFFSET_CONTENT: value = content; + break; + case P104_OFFSET_ALIGNMENT: value = alignment; + break; + case P104_OFFSET_ANIM_IN: value = animationIn; + break; + case P104_OFFSET_SPEED: value = speed; + break; + case P104_OFFSET_ANIM_OUT: value = animationOut; + break; + case P104_OFFSET_PAUSE: value = pause; + break; + case P104_OFFSET_FONT: value = font; + break; + case P104_OFFSET_LAYOUT: value = layout; + break; + case P104_OFFSET_SPEC_EFFECT: value = specialEffect; + break; + case P104_OFFSET_OFFSET: value = offset; + break; + case P104_OFFSET_BRIGHTNESS: value = brightness; + break; + case P104_OFFSET_REPEATDELAY: value = repeatDelay; + break; + case P104_OFFSET_INVERTED: value = inverted; + break; default: return false; @@ -2592,22 +2637,37 @@ bool P104_zone_struct::getIntValue(uint8_t offset, int32_t& value) const bool P104_zone_struct::setIntValue(uint8_t offset, int32_t value) { - switch (offset) { - case P104_OFFSET_SIZE: size = value; break; + switch (offset) + { + case P104_OFFSET_SIZE: size = value; + break; case P104_OFFSET_TEXT: return false; - case P104_OFFSET_CONTENT: content = value; break; - case P104_OFFSET_ALIGNMENT: alignment = value; break; - case P104_OFFSET_ANIM_IN: animationIn = value; break; - case P104_OFFSET_SPEED: speed = value; break; - case P104_OFFSET_ANIM_OUT: animationOut = value; break; - case P104_OFFSET_PAUSE: pause = value; break; - case P104_OFFSET_FONT: font = value; break; - case P104_OFFSET_LAYOUT: layout = value; break; - case P104_OFFSET_SPEC_EFFECT: specialEffect = value; break; - case P104_OFFSET_OFFSET: offset = value; break; - case P104_OFFSET_BRIGHTNESS: brightness = value; break; - case P104_OFFSET_REPEATDELAY: repeatDelay = value; break; - case P104_OFFSET_INVERTED: inverted = value; break; + case P104_OFFSET_CONTENT: content = value; + break; + case P104_OFFSET_ALIGNMENT: alignment = value; + break; + case P104_OFFSET_ANIM_IN: animationIn = value; + break; + case P104_OFFSET_SPEED: speed = value; + break; + case P104_OFFSET_ANIM_OUT: animationOut = value; + break; + case P104_OFFSET_PAUSE: pause = value; + break; + case P104_OFFSET_FONT: font = value; + break; + case P104_OFFSET_LAYOUT: layout = value; + break; + case P104_OFFSET_SPEC_EFFECT: specialEffect = value; + break; + case P104_OFFSET_OFFSET: offset = value; + break; + case P104_OFFSET_BRIGHTNESS: brightness = value; + break; + case P104_OFFSET_REPEATDELAY: repeatDelay = value; + break; + case P104_OFFSET_INVERTED: inverted = value; + break; default: return false; diff --git a/src/src/PluginStructs/P104_data_struct.h b/src/src/PluginStructs/P104_data_struct.h index c43b36e41a..ff874ae723 100644 --- a/src/src/PluginStructs/P104_data_struct.h +++ b/src/src/PluginStructs/P104_data_struct.h @@ -27,23 +27,24 @@ // # endif // if defined(PLUGIN_SET_MAX) || defined(PLUGIN_BUILD_CUSTOM) || ((defined(PLUGIN_DISPLAY_A_COLLECTION) || // defined(PLUGIN_DISPLAY_B_COLLECTION)) && defined(ESP32)) # endif // ifdef ESP32 -# define P104_USE_FULL_DOUBLEHEIGHT_FONT // Enables the use of a full (lower ascii only) set double height font -# define P104_USE_VERTICAL_FONT // Enables the use of a vertical font -# define P104_USE_EXT_ASCII_FONT // Enables the use of an extended ascii font -# define P104_USE_ARABIC_FONT // Enables the use of a Arabic font (see usage in MD_Parola examples) -# define P104_USE_GREEK_FONT // Enables the use of a Greek font (see usage in MD_Parola examples) -# define P104_USE_KATAKANA_FONT // Enables the use of a Katakana font (see usage in MD_Parola examples) -# define P104_USE_COMMANDS // Enables the use of all commands, not just clear, txt, settxt and update -# define P104_USE_DATETIME_OPTIONS // Enables extra date/time options -# define P104_USE_BAR_GRAPH // Enables the use of Bar-graph feature -# define P104_USE_ZONE_ACTIONS // Enables the use of Actions per zone (New above/New below/Delete) -# define P104_USE_ZONE_ORDERING // Enables the use of Zone ordering (Numeric order (1..n)/Display order (n..1)) -# define P104_USE_DOT_SET // Enables the use of Dot-set feature - -# define P104_ADD_SETTINGS_NOTES // Adds some notes on the Settings page +# define P104_USE_FULL_DOUBLEHEIGHT_FONT // Enables the use of a full (lower ascii only) set double height font +# define P104_USE_VERTICAL_FONT // Enables the use of a vertical font +# define P104_USE_EXT_ASCII_FONT // Enables the use of an extended ascii font +# define P104_USE_ARABIC_FONT // Enables the use of an Arabic font (see usage in MD_Parola examples) +# define P104_USE_GREEK_FONT // Enables the use of a Greek font (see usage in MD_Parola examples) +# define P104_USE_KATAKANA_FONT // Enables the use of a Katakana font (see usage in MD_Parola examples) +# define P104_USE_CYRILLIC_EXT_FONT // Enables the use of an ASCII font with Cyrillic extended characters +# define P104_USE_COMMANDS // Enables the use of all commands, not just clear, txt, settxt and update +# define P104_USE_DATETIME_OPTIONS // Enables extra date/time options +# define P104_USE_BAR_GRAPH // Enables the use of Bar-graph feature +# define P104_USE_ZONE_ACTIONS // Enables the use of Actions per zone (New above/New below/Delete) +# define P104_USE_ZONE_ORDERING // Enables the use of Zone ordering (Numeric order (1..n)/Display order (n..1)) +# define P104_USE_DOT_SET // Enables the use of Dot-set feature + +# define P104_ADD_SETTINGS_NOTES // Adds some notes on the Settings page # if FEATURE_EXTENDED_CUSTOM_SETTINGS && defined(ESP32) && defined(USE_LITTLEFS) -# define P104_FEATURE_STORAGE_V3 1 // Only enable saving in storage for ESP32 +# define P104_FEATURE_STORAGE_V3 1 // Only enable saving in storage for ESP32 # else // if FEATURE_EXTENDED_CUSTOM_SETTINGS && defined(ESP32) && defined(USE_LITTLEFS) # define P104_FEATURE_STORAGE_V3 0 # endif // if FEATURE_EXTENDED_CUSTOM_SETTINGS && defined(ESP32) && defined(USE_LITTLEFS) @@ -71,6 +72,9 @@ # ifdef P104_USE_KATAKANA_FONT # undef P104_USE_KATAKANA_FONT # endif // ifdef P104_USE_KATAKANA_FONT +# ifdef P104_USE_CYRILLIC_EXT_FONT +# undef P104_USE_CYRILLIC_EXT_FONT +# endif // ifdef P104_USE_CYRILLIC_EXT_FONT // # ifdef P104_USE_COMMANDS // # undef P104_USE_COMMANDS // # endif // ifdef P104_USE_COMMANDS @@ -87,7 +91,8 @@ # undef P104_DEBUG_DEV # endif // ifdef P104_DEBUG_DEV # define P104_MEDIUM_ANIMATIONS -# endif // if (defined(PLUGIN_DISPLAY_A_COLLECTION) || defined(PLUGIN_DISPLAY_B_COLLECTION)) && defined(ESP8266) && !defined(LIMIT_BUILD_SIZE) +# endif // if (defined(PLUGIN_DISPLAY_A_COLLECTION) || defined(PLUGIN_DISPLAY_B_COLLECTION)) && defined(ESP8266) && +// !defined(LIMIT_BUILD_SIZE) // # define P104_MINIMAL_ANIMATIONS // disable most animations // # define P104_MEDIUM_ANIMATIONS // disable some complex animations @@ -142,6 +147,9 @@ # ifdef P104_USE_KATAKANA_FONT # undef P104_USE_KATAKANA_FONT # endif // ifdef P104_USE_KATAKANA_FONT +# ifdef P104_USE_CYRILLIC_EXT_FONT +# undef P104_USE_CYRILLIC_EXT_FONT +# endif // ifdef P104_USE_CYRILLIC_EXT_FONT # endif // ifdef LIMIT_BUILD_SIZE # if defined(P104_USE_TOOLTIPS) && !FEATURE_TOOLTIPS @@ -319,6 +327,13 @@ const uint8_t P104_DOUBLE_CHAR_SPACING = 2; // Character spacing for double-heig # include "../Static/Fonts/P104_font_katakana.h" # endif // ifdef P104_USE_KATAKANA_FONT +# ifdef P104_USE_CYRILLIC_EXT_FONT + +# define P104_CYRILLIC_EXT_FONT_ID 8 + +# include "../Static/Fonts/P104_font_cyr_ext.h" +# endif // ifdef P104_USE_CYRILLIC_EXT_FONT + struct P104_zone_struct { P104_zone_struct() = delete; // Not used, so leave out explicitly P104_zone_struct(uint8_t _zone); @@ -352,6 +367,7 @@ struct P104_zone_struct { int32_t& value) const; bool setIntValue(uint8_t offset, int32_t value); + }; # ifdef P104_USE_BAR_GRAPH @@ -365,7 +381,9 @@ struct P104_bargraph_struct { uint8_t graph; uint8_t barType = 0u; uint8_t direction = 0u; + }; + # endif // ifdef P104_USE_BAR_GRAPH struct P104_data_struct : public PluginTaskData_base { @@ -381,20 +399,17 @@ struct P104_data_struct : public PluginTaskData_base { void loadSettings(); bool webform_load(struct EventStruct *event); bool webform_save(struct EventStruct *event); - String getError() { - return error; - } - void configureZones(); + String getError() { return error; } - void setZones(uint16_t _zones) { - expectedZones = _zones; - } + void configureZones(); - bool handlePluginWrite(taskIndex_t taskIndex, - const String& string); - bool handlePluginOncePerSecond(struct EventStruct *event); - void checkRepeatTimer(uint8_t z); + void setZones(uint16_t _zones) { expectedZones = _zones; } + + bool handlePluginWrite(taskIndex_t taskIndex, + const String& string); + bool handlePluginOncePerSecond(struct EventStruct *event); + void checkRepeatTimer(uint8_t z); MD_Parola *P = nullptr; @@ -492,9 +507,13 @@ struct P104_data_struct : public PluginTaskData_base { struct { uint16_t P104_dataSize; char P104_data[P104_SETTINGS_BUFFER_V2 + 1]; + }; + uint8_t P104_storeThis[P104_SETTINGS_BUFFER_V2 + 1 + sizeof(uint16_t)]{}; + }; + }; #endif // ifdef USES_P104 diff --git a/src/src/Static/Fonts/P104_font_cyr_ext.h b/src/src/Static/Fonts/P104_font_cyr_ext.h new file mode 100644 index 0000000000..a036bd0fea --- /dev/null +++ b/src/src/Static/Fonts/P104_font_cyr_ext.h @@ -0,0 +1,261 @@ +#pragma once + +MD_MAX72XX::fontType_t font_cyr_ext[] PROGMEM = // ASCII with Cyrillic extension +{ + 0, // 0 - Empty Cell + 5, 62, 91, 79, 91, 62, // 1 - Sad Smiley + 5, 62, 107, 79, 107, 62, // 2 - Happy Smiley + 5, 28, 62, 124, 62, 28, // 3 - Heart + 5, 24, 60, 126, 60, 24, // 4 - Diamond + 5, 28, 87, 125, 87, 28, // 5 - Clubs + 5, 28, 94, 127, 94, 28, // 6 - Spades + 3, 24, 60, 24, // 7 - Bullet Point + 5, 255, 231, 195, 231, 255, // 8 - Rev Bullet Point + 3, 24, 36, 24, // 9 - Hollow Bullet Point + 5, 255, 231, 219, 231, 255, // 10 - Rev Hollow BP + 5, 48, 72, 58, 6, 14, // 11 - Male + 5, 38, 41, 121, 41, 38, // 12 - Female + 5, 64, 127, 5, 5, 7, // 13 - Music Note 1 + 5, 64, 127, 5, 37, 63, // 14 - Music Note 2 + 5, 90, 60, 231, 60, 90, // 15 - Snowflake + 5, 127, 62, 28, 28, 8, // 16 - Right Pointer + 5, 8, 28, 28, 62, 127, // 17 - Left Pointer + 5, 20, 34, 127, 34, 20, // 18 - UpDown Arrows + 5, 95, 95, 0, 95, 95, // 19 - Double Exclamation + 5, 6, 9, 127, 1, 127, // 20 - Paragraph Mark + 4, 102, 137, 149, 106, // 21 - Section Mark + 5, 96, 96, 96, 96, 96, // 22 - Double Underline + 5, 148, 162, 255, 162, 148, // 23 - UpDown Underlined + 5, 8, 4, 126, 4, 8, // 24 - Up Arrow + 5, 16, 32, 126, 32, 16, // 25 - Down Arrow + 5, 8, 8, 42, 28, 8, // 26 - Right Arrow + 5, 8, 28, 42, 8, 8, // 27 - Left Arrow + 5, 30, 16, 16, 16, 16, // 28 - Angled + 5, 12, 30, 12, 30, 12, // 29 - Squashed # + 5, 48, 56, 62, 56, 48, // 30 - Up Pointer + 5, 6, 14, 62, 14, 6, // 31 - Down Pointer + 2, 0, 0, // 32 - Space + 1, 95, // 33 - ! + 3, 3, 0, 3, // 34 - " + 5, 20, 62, 20, 62, 20, // 35 - # + 4, 36, 106, 43, 18, // 36 - $ + 5, 99, 19, 8, 100, 99, // 37 - % + 5, 54, 73, 86, 32, 80, // 38 - & + 1, 3, // 39 - ' + 3, 28, 34, 65, // 40 - ( + 3, 65, 34, 28, // 41 - ) + 5, 40, 24, 14, 24, 40, // 42 - * + 5, 8, 8, 62, 8, 8, // 43 - + + 2, 176, 112, // 44 - , + 4, 8, 8, 8, 8, // 45 - - + 2, 96, 96, // 46 - . + 4, 96, 24, 6, 1, // 47 - / + 4, 62, 65, 65, 62, // 48 - 0 + 3, 66, 127, 64, // 49 - 1 + 4, 98, 81, 73, 70, // 50 - 2 + 4, 34, 65, 73, 54, // 51 - 3 + 4, 24, 20, 18, 127, // 52 - 4 + 4, 39, 69, 69, 57, // 53 - 5 + 4, 62, 73, 73, 48, // 54 - 6 + 4, 97, 17, 9, 7, // 55 - 7 + 4, 54, 73, 73, 54, // 56 - 8 + 4, 6, 73, 73, 62, // 57 - 9 + 1, 80, // 58 - : + 2, 128, 80, // 59 - ; + 3, 16, 40, 68, // 60 - < + 3, 20, 20, 20, // 61 - = + 3, 68, 40, 16, // 62 - > + 4, 2, 89, 9, 6, // 63 - ? + 5, 62, 73, 85, 93, 14, // 64 - @ + 4, 126, 17, 17, 126, // 65 - A + 4, 127, 73, 73, 54, // 66 - B + 4, 62, 65, 65, 34, // 67 - C + 4, 127, 65, 65, 62, // 68 - D + 4, 127, 73, 73, 65, // 69 - E + 4, 127, 9, 9, 1, // 70 - F + 4, 62, 65, 73, 122, // 71 - G + 4, 127, 8, 8, 127, // 72 - H + 3, 65, 127, 65, // 73 - I + 4, 48, 64, 65, 63, // 74 - J + 4, 127, 8, 20, 99, // 75 - K + 4, 127, 64, 64, 64, // 76 - L + 5, 127, 2, 12, 2, 127, // 77 - M + 5, 127, 4, 8, 16, 127, // 78 - N + 4, 62, 65, 65, 62, // 79 - O + 4, 127, 9, 9, 6, // 80 - P + 4, 62, 65, 65, 190, // 81 - Q + 4, 127, 9, 9, 118, // 82 - R + 4, 70, 73, 73, 50, // 83 - S + 5, 1, 1, 127, 1, 1, // 84 - T + 4, 63, 64, 64, 63, // 85 - U + 5, 15, 48, 64, 48, 15, // 86 - V + 5, 63, 64, 56, 64, 63, // 87 - W + 5, 99, 20, 8, 20, 99, // 88 - X + 5, 7, 8, 112, 8, 7, // 89 - Y + 4, 97, 81, 73, 71, // 90 - Z + 2, 127, 65, // 91 - [ + 4, 1, 6, 24, 96, // 92 - \ backslash + 2, 65, 127, // 93 - ] + 3, 2, 1, 2, // 94 - ^ + 4, 64, 64, 64, 64, // 95 - _ + 2, 1, 2, // 96 - ` + 4, 32, 84, 84, 120, // 97 - a + 4, 127, 68, 68, 56, // 98 - b + 4, 56, 68, 68, 40, // 99 - c + 4, 56, 68, 68, 127, // 100 - d + 4, 56, 84, 84, 24, // 101 - e + 3, 4, 126, 5, // 102 - f + 4, 152, 164, 164, 120, // 103 - g + 4, 127, 4, 4, 120, // 104 - h + 3, 68, 125, 64, // 105 - i + 4, 64, 128, 132, 125, // 106 - j + 4, 127, 16, 40, 68, // 107 - k + 3, 65, 127, 64, // 108 - l + 5, 124, 4, 124, 4, 120, // 109 - m + 4, 124, 4, 4, 120, // 110 - n + 4, 56, 68, 68, 56, // 111 - o + 4, 252, 36, 36, 24, // 112 - p + 4, 24, 36, 36, 252, // 113 - q + 4, 124, 8, 4, 4, // 114 - r + 4, 72, 84, 84, 36, // 115 - s + 3, 4, 63, 68, // 116 - t + 4, 60, 64, 64, 124, // 117 - u + 5, 28, 32, 64, 32, 28, // 118 - v + 5, 60, 64, 60, 64, 60, // 119 - w + 5, 68, 40, 16, 40, 68, // 120 - x + 4, 156, 160, 160, 124, // 121 - y + 3, 100, 84, 76, // 122 - z + 3, 8, 54, 65, // 123 - { + 1, 127, // 124 - | + 3, 65, 54, 8, // 125 - } + 4, 8, 4, 8, 4, // 126 - ~ + 0, // 127 - 0 + 5, 252, 36, 36, 36, 24, // 128 - 'р' + 5, 120, 132, 132, 132, 72, // 129 - 'с' + 5, 4, 4, 252, 4, 4, // 130 - 'т' + 5, 76, 144, 144, 144, 124, // 131 - 'у' + 5, 56, 68, 254, 68, 56, // 132 - 'ф' + 5, 196, 40, 16, 40, 196, // 133 - 'х' + 5, 124, 64, 64, 124, 192, // 134 - 'ц' + 5, 28, 32, 32, 32, 252, // 135 - 'ч' + 5, 252, 128, 252, 128, 252, // 136 - 'ш' + 5, 124, 64, 124, 64, 252, // 137 - 'щ' + 5, 4, 252, 144, 144, 96, // 138 - 'ъ' + 5, 252, 144, 240, 0, 252, // 139 - 'ы' + 4, 252, 144, 144, 96, // 140 - 'ь' + 5, 72, 132, 148, 148, 120, // 141 - 'э' + 5, 252, 32, 252, 132, 252, // 142 - 'ю' + 5, 24, 164, 100, 36, 252, // 143 - 'я' + 5, 248, 36, 34, 33, 255, // 144 - 'А' + 5, 255, 137, 137, 137, 112, // 145 - 'Б' + 5, 255, 137, 137, 137, 118, // 146 - 'В' + 4, 255, 1, 1, 3, // 147 - 'Г' + 6, 192, 126, 65, 65, 127, 192, // 148 - 'Д' + 4, 255, 137, 137, 129, // 149 - 'Е' + 5, 247, 8, 255, 8, 247, // 150 - 'Ж' + 5, 66, 129, 137, 137, 118, // 151 - 'З' + 5, 255, 32, 16, 8, 255, // 152 - 'И' + 5, 254, 32, 17, 8, 254, // 153 - 'Й' + 5, 255, 8, 20, 34, 193, // 154 - 'К' + 5, 128, 124, 2, 1, 255, // 155 - 'Л' + 5, 255, 4, 24, 4, 255, // 156 - 'М' + 5, 255, 8, 8, 8, 255, // 157 - 'Н' + 5, 126, 129, 129, 129, 126, // 158 - 'О' + 5, 255, 1, 1, 1, 255, // 159 - 'П' + 5, 255, 17, 17, 17, 14, // 160 - 'Р' + 5, 126, 129, 129, 129, 66, // 161 - 'С' + 5, 3, 1, 255, 1, 3, // 162 - 'Т' + 5, 71, 136, 144, 144, 127, // 163 - 'У' + 5, 60, 66, 255, 66, 60, // 164 - 'Ф' + 5, 227, 20, 8, 20, 227, // 165 - 'Х' + 5, 127, 64, 64, 127, 192, // 166 - 'Ц' + 5, 15, 16, 16, 16, 255, // 167 - 'Ч' + 5, 255, 128, 254, 128, 255, // 168 - 'Ш' + 5, 127, 64, 126, 64, 255, // 169 - 'Щ' + 5, 1, 255, 136, 136, 112, // 170 - 'Ъ' + 5, 255, 132, 120, 0, 255, // 171 - 'Ы' + 4, 255, 136, 136, 112, // 172 - 'Ь' + 5, 66, 129, 137, 137, 126, // 173 - 'Э' + 6, 255, 16, 126, 129, 129, 126, // 174 - 'Ю' + 5, 142, 81, 49, 17, 255, // 175 - 'Я' + 5, 96, 148, 148, 248, 128, // 176 - 'а' + 4, 252, 148, 148, 96, // 177 - 'б' + 4, 252, 148, 148, 104, // 178 - 'в' + 4, 252, 4, 4, 12, // 179 - 'г' + 5, 192, 124, 68, 124, 192, // 180 - 'д' + 5, 120, 164, 164, 164, 24, // 181 - 'е' + 5, 236, 16, 252, 16, 236, // 182 - 'ж' + 5, 72, 132, 148, 148, 104, // 183 - 'з' + 5, 252, 64, 32, 16, 252, // 184 - 'и' + 5, 252, 64, 34, 16, 252, // 185 - 'й' + 5, 252, 16, 40, 68, 128, // 186 - 'к' + 5, 128, 240, 8, 4, 252, // 187 - 'л' + 5, 252, 16, 224, 16, 252, // 188 - 'м' + 5, 252, 16, 16, 16, 252, // 189 - 'н' + 5, 120, 132, 132, 132, 120, // 190 - 'о' + 5, 252, 4, 4, 4, 252, // 191 - 'п' + 4, 125, 84, 84, 85, // 192 - Ё + 4, 57, 84, 84, 73, // 193 - ё + 5, 0, 0, 0, 255, 16, // 194 - Left T + 5, 16, 16, 16, 16, 16, // 195 - Top side + 5, 16, 16, 16, 255, 16, // 196 - Center + + 5, 0, 0, 0, 255, 20, // 197 - Left side double H + 5, 0, 0, 255, 0, 255, // 198 - Left side double + 5, 0, 0, 31, 16, 23, // 199 - Bot Left double V + 5, 0, 0, 252, 4, 244, // 200 - Top Left double V + 5, 20, 20, 23, 16, 23, // 201 - Bot T double + 5, 20, 20, 244, 4, 244, // 202 - Top T double + 5, 0, 0, 255, 0, 247, // 203 - Left Side double spl + 5, 20, 20, 20, 20, 20, // 204 - Center double + 5, 20, 20, 247, 0, 247, // 205 - Center + double + 5, 20, 20, 20, 23, 20, // 206 - Bot T double H + 5, 16, 16, 31, 16, 31, // 207 - Bot Right double V + 0, // 208 - for rus fonts UTF-8 + 0, // 209 - for rus fonts UTF-8 + 5, 0, 0, 31, 16, 31, // 210 - Bot Left double V + 5, 0, 0, 0, 31, 20, // 211 - Bot Right double H + 5, 0, 0, 0, 252, 20, // 212 - Top Right double H + 5, 0, 0, 240, 16, 240, // 213 - Top Right double V + 5, 16, 16, 255, 16, 255, // 214 - Center + double V + 5, 20, 20, 20, 255, 20, // 215 - Center + double H + 5, 16, 16, 16, 16, 31, // 216 - Bot Right + 5, 0, 0, 0, 240, 16, // 217 - Top Left + 5, 255, 255, 255, 255, 255, // 218 - Full Block + 5, 240, 240, 240, 240, 240, // 219 - Half Block Bottom + 3, 255, 255, 255, // 220 - Half Block LHS + 5, 0, 0, 0, 255, 255, // 221 - Half Block RHS + 5, 15, 15, 15, 15, 15, // 222 - Half Block Top + 5, 56, 68, 68, 56, 68, // 223 - Alpha + 5, 124, 42, 42, 62, 20, // 224 - Beta + 5, 126, 2, 2, 6, 6, // 225 - Gamma + 5, 2, 126, 2, 126, 2, // 226 - Pi + 5, 99, 85, 73, 65, 99, // 227 - Sigma + 5, 56, 68, 68, 60, 4, // 228 - Theta + 5, 64, 126, 32, 30, 32, // 229 - mu + 5, 6, 2, 126, 2, 2, // 230 - Tau + 5, 153, 165, 231, 165, 153, // 231 - 0 + 5, 28, 42, 73, 42, 28, // 232 - 0 + 5, 76, 114, 1, 114, 76, // 233 - 0 + 5, 48, 74, 77, 77, 48, // 234 - 0 + 5, 48, 72, 120, 72, 48, // 235 - 0 + 5, 188, 98, 90, 70, 61, // 236 - Zero Slashed + 4, 62, 73, 73, 73, // 237 - 0 + 5, 126, 1, 1, 1, 126, // 238 - 0 + 5, 42, 42, 42, 42, 42, // 239 - 3 Bar Equals + 5, 68, 68, 95, 68, 68, // 240 - +/- + 5, 64, 81, 74, 68, 64, // 241 - >= + 5, 64, 68, 74, 81, 64, // 242 - <= + 5, 0, 0, 255, 1, 3, // 243 - Top of Integral + 3, 224, 128, 255, // 244 - Bot of Integral + 5, 8, 8, 107, 107, 8, // 245 - Divide + 5, 54, 18, 54, 36, 54, // 246 - Wavy = + 5, 6, 15, 9, 15, 6, // 247 - Degree + 4, 0, 0, 24, 24, // 248 - Math Product + 4, 0, 0, 16, 16, // 249 - Short Dash + 5, 48, 64, 255, 1, 1, // 250 - Square Root + 5, 0, 31, 1, 1, 30, // 251 - Superscript n + 5, 0, 25, 29, 23, 18, // 252 - Superscript 2 + 5, 0, 60, 60, 60, 60, // 253 - Centered Square + 5, 255, 129, 129, 129, 255, // 254 - Full Frame + 5, 255, 255, 255, 255, 255, // 255 - Full Block +};