From ab3a071f644c2983acc222d6f4cea56b1679251d Mon Sep 17 00:00:00 2001 From: schreibfaul1 Date: Sun, 28 Jul 2024 21:30:16 +0200 Subject: [PATCH] fix Remnants of a long title. #469 --- boards/esp32s3-usb.json | 46 --------------------------------- lib/tftLib/src/fonts/Garamond.h | 2 +- src/common.h | 13 ++++++++-- src/main.cpp | 21 +++++++++++++-- 4 files changed, 31 insertions(+), 51 deletions(-) delete mode 100644 boards/esp32s3-usb.json diff --git a/boards/esp32s3-usb.json b/boards/esp32s3-usb.json deleted file mode 100644 index 9d102f15..00000000 --- a/boards/esp32s3-usb.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "build": { - "arduino":{ - "ldscript": "esp32s3_out.ld", - "partitions": "default_8MB.csv", - "memory_type": "qio_qspi" - }, - "core": "esp32", - "extra_flags": [ - "-DARDUINO_TINYS3" - ], - "f_cpu": "240000000L", - "f_flash": "80000000L", - "flash_mode": "qio", - "hwids": [ - [ - "0X303A", - "0x80D0" - ] - ], - "mcu": "esp32s3", - "variant": "um_tinys3" - }, - "connectivity": [ - "wifi" - ], - "debug": { - "openocd_target": "esp32s3.cfg" - }, - "frameworks": [ - "arduino", - "espidf" - ], - "name": "Unexpected Maker TinyS3", - "upload": { - "flash_size": "8MB", - "maximum_ram_size": 327680, - "maximum_size": 8388608, - "use_1200bps_touch": true, - "wait_for_upload_port": true, - "require_upload_port": true, - "speed": 460800 - }, - "url": "https://unexpectedmaker.com/shop/ttinys3-esp32s3", - "vendor": "Unexpected Maker" - } \ No newline at end of file diff --git a/lib/tftLib/src/fonts/Garamond.h b/lib/tftLib/src/fonts/Garamond.h index 83b254dc..efd9154f 100644 --- a/lib/tftLib/src/fonts/Garamond.h +++ b/lib/tftLib/src/fonts/Garamond.h @@ -10837,7 +10837,7 @@ static const lv_font_fmt_txt_cmap_t cmaps_Garamond27[] = {{.range_start = 1, .range_length = 1327, .font_height = 27, .line_height = 32, - .base_line = 3, + .base_line = 8, .glyph_id_start = 1, .unicode_list = NULL, .glyph_id_ofs_list = NULL, diff --git a/src/common.h b/src/common.h index 24143457..1bb5d980 100644 --- a/src/common.h +++ b/src/common.h @@ -1,5 +1,5 @@ // created: 10.Feb.2022 -// updated: 25.Jul 2024 +// updated: 28.Jul 2024 #pragma once #pragma GCC optimize("Os") // optimize for code size @@ -747,6 +747,11 @@ class textbox{ uint8_t m_fontSize = 0; uint8_t m_h_align = TFT_ALIGN_RIGHT; uint8_t m_v_align = TFT_ALIGN_TOP; + uint8_t m_l_margin = 0; // left margin + uint8_t m_r_margin = 0; // right margin + uint8_t m_t_margin = 0; // top margin + uint8_t m_b_margin = 0; // bottom margin + uint8_t m_d_margin = 0; uint32_t m_bgColor = 0; uint32_t m_fgColor = 0; char* m_text = NULL; @@ -772,6 +777,10 @@ class textbox{ m_y = y; // y pos m_w = w; // width m_h = h; // high + m_l_margin = 0; + m_r_margin = w / 100; + m_t_margin = 0; + m_b_margin = h / 50; } void show(){ m_enabled = true; @@ -838,7 +847,7 @@ class textbox{ tft.setBackGoundColor(m_bgColor); tft.fillRect(m_x, m_y, m_w, m_h, m_bgColor); if(m_fontSize != 0){ tft.setFont(m_fontSize);} - tft.writeText(m_text, m_x, m_y, m_w, m_h, m_h_align, m_v_align, false, false, m_autoSize); + tft.writeText(m_text, m_x + m_l_margin, m_y + m_t_margin, m_w - m_r_margin, m_h - m_d_margin, m_h_align, m_v_align, false, false, m_autoSize); tft.setTextColor(txtColor_tmp); tft.setBackGoundColor(bgColor_tmp); } diff --git a/src/main.cpp b/src/main.cpp index cb672052..77a00d1e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,7 +4,7 @@ MiniWebRadio -- Webradio receiver for ESP32 first release on 03/2017 */String Version ="\ - Version 3.3b Jul 27/2024 "; + Version 3.3c Jul 28/2024 "; /* 2.8" color display (320x240px) with controller ILI9341 or HX8347D (SPI) or 3.5" color display (480x320px) with controller ILI9486 or ILI9488 (SPI) @@ -2784,7 +2784,7 @@ void loop() { { SerialPrintfln("Terminal : " ANSI_ESC_YELLOW "mute increment"); } audioMute(false); } - if(r.startsWith("s")) { + if(r.startsWith("rts")) { char timeStatsBuffer[1024 * 2]; GetRunTimeStats(timeStatsBuffer); { SerialPrintfln("Terminal : " ANSI_ESC_YELLOW "task statistics\n\n%s", timeStatsBuffer); } @@ -2797,6 +2797,23 @@ void loop() { if(audioSetTimeOffset(r.toInt())) { SerialPrintfln("Terminal : " ANSI_ESC_YELLOW "TimeOffset %li", r.toInt()); } else { SerialPrintfln("Terminal : " ANSI_ESC_YELLOW "TimeOffset not possible"); } } + if(r.startsWith("bfi")){ // buffer filled + SerialPrintfln("inBuffer : filled %lu bytes", (long unsigned)audioInbuffFilled()); + SerialPrintfln("inBuffer : free %lu bytes", (long unsigned)audioInbuffFree()); + } + if(r.startsWith("st")){ // testtext for streamtitle + if(r[2] == '0') strcpy(_streamTitle, "A B C D E F G H I"); + if(r[2] == '1') strcpy(_streamTitle, "A B C D E F G H I"); + if(r[2] == '2') strcpy(_streamTitle, "A B C D E F G H I J K L"); + if(r[2] == '4') strcpy(_streamTitle, "A B C D E F G H I J K J M Q O"); + if(r[2] == '5') strcpy(_streamTitle, "A B C D E F G H I K L J M y O P Q R"); + if(r[2] == '6') strcpy(_streamTitle, "A B C D E F G H I K L J M g O P Q R S T V A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q V A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q"); + if(r[2] == '7') strcpy(_streamTitle, "A B C D E F G H I K L J M j O P Q R S T U V A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q"); + if(r[2] == '8') strcpy(_streamTitle, "A B C D E F G H I K L J M p O P Q R S T U V W A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q"); + if(r[2] == '9') strcpy(_streamTitle, "A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q"); + log_i("st: %s", _streamTitle); + _f_newStreamTitle = true; + } } }