even faster boot up and completly new start screen

This commit is contained in:
2026-01-14 20:57:32 +01:00
parent 77b7f45d90
commit f5a03c7e6c
30 changed files with 7313 additions and 7758 deletions

View File

@@ -574,7 +574,7 @@ class TEF6686 {
void setVolume(int8_t volume);
void tone(uint16_t time, int16_t amplitude, uint16_t frequency);
void extendBW(bool yesno);
uint16_t getBlockA(void);
uint16_t getBlockA();
uint8_t af_counter;
uint8_t eon_counter;
uint8_t logbook_counter;

View File

@@ -16,11 +16,6 @@
#define TOUCHIRQ 33
#define EXT_IRQ 14
#ifndef DEEPELEC_DP_66X
#define STANDBYLED 19
#define SMETERPIN 27
#endif
#define XL9555_ADDRESS 0x20 // GPIO driver used in the DP666 for the 0-9 + DX(Backspace) + Enter buttons
#define TEF668X_ADDRESS 0x64 // I2C address of the TEF itself! Not sure if this even changes
@@ -269,7 +264,7 @@
#define EE_BYTE_ROTARYMODE 2118
#define EE_BYTE_STEPSIZE 2119
#define EE_BYTE_TUNEMODE 2120
#define EE_BYTE_OPTENC 2121
// empty byte
#define EE_BYTE_CHECKBYTE 2122
#define EE_BYTE_IMSSET 2123
#define EE_BYTE_EQSET 2124

View File

@@ -39,7 +39,6 @@ extern bool memorystore;
extern bool memreset, memtune;
extern bool menu, menuopen;
extern bool mwstepsize;
extern bool optenc;
extern bool rdsflagreset;
extern bool rdsreset;
extern bool rdsstatscreen;

File diff suppressed because it is too large Load Diff

View File

@@ -16,13 +16,13 @@ private:
std::function<void(TFT_eSprite*, bool)> postDrawCallback;
int usedW;
int usedH;
static const unsigned long SCROLL_INTERVAL = 5;
static const unsigned long HOLD_DURATION = 2000;
static const int SCROLL_GAP = 10;
public:
ScrollingTextDisplay(TFT_eSprite* spr, int y, int maxW, int inuseW = -1, int inuseH = -1 ) :
ScrollingTextDisplay(TFT_eSprite* spr, int y, int maxW, int inuseW = -1, int inuseH = -1 ) :
sprite(spr), yPos(y), maxWidth(maxW), xPos(0), textWidth(0), lastTick(0), holdTick(0), isScrolling(false), postDrawCallback(nullptr), usedW(inuseW), usedH(inuseH) {}
void setPostDrawCallback(std::function<void(TFT_eSprite*, bool)> callback) {
@@ -31,7 +31,7 @@ public:
void update(const String& text, bool status, uint16_t activeColor, uint16_t activeSmooth, uint16_t dropoutColor, uint16_t dropoutSmooth, uint16_t backgroundColor) {
textWidth = sprite->textWidth(text);
if(textWidth < maxWidth) {
xPos = 0;
isScrolling = false;
@@ -41,7 +41,7 @@ public:
isScrolling = true;
if(millis() - lastTick >= SCROLL_INTERVAL) {
if(xPos <= -(textWidth + SCROLL_GAP)) xPos = 0;
if(xPos == 0) {
if(millis() - holdTick >= HOLD_DURATION) {
xPos--;
@@ -51,7 +51,7 @@ public:
xPos--;
holdTick = millis();
}
drawText(text, status, activeColor, activeSmooth, dropoutColor, dropoutSmooth, backgroundColor);
lastTick = millis();
}
@@ -77,25 +77,28 @@ private:
if(usedW > 0 && usedH > 0) {
sprite->fillSprite(TFT_TRANSPARENT);
sprite->fillRect(0, 0, usedW, usedH, backgroundColor);
sprite->setViewport(0, 0, usedW, usedH);
if(status) sprite->setTextColor(activeColor, activeSmooth, false);
else sprite->setTextColor(dropoutColor, dropoutSmooth, false);
sprite->drawString(text, xPos, 0);
if(isScrolling) sprite->drawString(text, xPos + textWidth + SCROLL_GAP, 0);
sprite->resetViewport();
} else {
sprite->fillSprite(backgroundColor);
if(status) sprite->setTextColor(activeColor, activeSmooth, false);
else sprite->setTextColor(dropoutColor, dropoutSmooth, false);
sprite->drawString(text, xPos, 0);
if(isScrolling) sprite->drawString(text, xPos + textWidth + SCROLL_GAP, 0);
}
sprite->fillRect(0, sprite->fontHeight(), sprite->width(), sprite->height() - sprite->fontHeight(), TFT_TRANSPARENT);
if(postDrawCallback) postDrawCallback(sprite, false);
sprite->pushSprite(35, yPos, TFT_TRANSPARENT);
}

19
include/system_console.h Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
class Console {
public:
explicit Console(TFT_eSPI* display) : tft(display), y(0) {}
void print(String text) {
tft->setTextColor(TFT_WHITE, TFT_BLACK);
tft->setTextDatum(TL_DATUM);
auto data = "[" + String(millis() / 1000.0f) + "] " + text;
tft->fillRect(0, y, tft->textWidth(data), tft->fontHeight(0), TFT_BLACK);
tft->drawString(data, 0, y, 0);
y += tft->fontHeight(0);
}
private:
TFT_eSPI* tft;
int y = 0;
};