Lots of minor changes

This commit is contained in:
2026-02-14 18:29:55 +01:00
parent 8d5e41846b
commit d79358fa48
9 changed files with 2486 additions and 3293 deletions
+2122 -2144
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -9,9 +9,9 @@ public:
tft->setTextColor(TFT_WHITE, background);
tft->setTextDatum(TL_DATUM);
auto data = "[" + String(millis() / 1000.0f) + "] " + text;
tft->fillRect(0, y, tft->textWidth(data), tft->fontHeight(0), background);
tft->drawString(data, 0, y, 0);
y += tft->fontHeight(0);
tft->fillRect(0, y, tft->textWidth(data), tft->fontHeight(2), background);
tft->drawString(data, 0, y, 2);
y += tft->fontHeight(2);
}
void reset() {
y = 0;
+112 -860
View File
File diff suppressed because it is too large Load Diff
+56 -89
View File
@@ -241,7 +241,6 @@ static const uint16_t default_4bit_palette[] PROGMEM = {
typedef uint16_t (*getColorCallback)(uint16_t x, uint16_t y);
class TFT_eSPI { friend class TFT_eSprite;
public:
void setSPISpeed(uint8_t speed_Mhz);
TFT_eSPI(int16_t _W = TFT_WIDTH, int16_t _H = TFT_HEIGHT);
@@ -266,9 +265,7 @@ class TFT_eSPI { friend class TFT_eSprite;
void setAddrWindow(int32_t xs, int32_t ys, int32_t w, int32_t h);
void setViewport(int32_t x, int32_t y, int32_t w, int32_t h, bool vpDatum = true);
void resetViewport();
bool clipWindow(int32_t* xs, int32_t* ys, int32_t* xe, int32_t* ye);
void pushColor(uint16_t color, uint32_t len);
void pushColors(uint16_t *data, uint32_t len, bool swap = true);
void pushBlock(uint16_t color, uint32_t len);
void pushPixels(const void * data_in, uint32_t len);
void fillScreen(uint32_t color),
@@ -278,29 +275,20 @@ class TFT_eSPI { friend class TFT_eSprite;
void drawCircleHelper(int32_t x, int32_t y, int32_t r, uint8_t cornername, uint32_t color),
fillCircle(int32_t x, int32_t y, int32_t r, uint32_t color),
fillCircleHelper(int32_t x, int32_t y, int32_t r, uint8_t cornername, int32_t delta, uint32_t color),
drawEllipse(int16_t x, int16_t y, int32_t rx, int32_t ry, uint16_t color),
fillEllipse(int16_t x, int16_t y, int32_t rx, int32_t ry, uint16_t color),
fillTriangle(int32_t x1,int32_t y1, int32_t x2,int32_t y2, int32_t x3,int32_t y3, uint32_t color);
uint16_t drawPixel(int32_t x, int32_t y, uint32_t color, uint8_t alpha, uint32_t bg_color = 0x00FFFFFF);
void drawArc(int32_t x, int32_t y, int32_t r, int32_t ir, uint32_t startAngle, uint32_t endAngle, uint32_t fg_color, uint32_t bg_color, bool smoothArc = true);
void drawSmoothCircle(int32_t x, int32_t y, int32_t r, uint32_t fg_color, uint32_t bg_color);
void fillSmoothCircle(int32_t x, int32_t y, int32_t r, uint32_t color, uint32_t bg_color = 0x00FFFFFF);
void drawSmoothRoundRect(int32_t x, int32_t y, int32_t r, int32_t ir, int32_t w, int32_t h, uint32_t fg_color, uint32_t bg_color = 0x00FFFFFF, uint8_t quadrants = 0xF);
void fillSmoothRoundRect(int32_t x, int32_t y, int32_t w, int32_t h, int32_t radius, uint32_t color, uint32_t bg_color = 0x00FFFFFF);
void drawWedgeLine(float ax, float ay, float bx, float by, float aw, float bw, uint32_t fg_color, uint32_t bg_color = 0x00FFFFFF);
void setSwapBytes(bool swap);
bool getSwapBytes();
void drawBitmap( int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t fgcolor),
drawBitmap( int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t fgcolor, uint16_t bgcolor),
setBitmapColor(uint16_t fgcolor, uint16_t bgcolor);
void setPivot(int16_t x, int16_t y);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data, uint16_t transparent);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data, uint16_t transparent);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *data, bool bpp8 = true, uint16_t *cmap = nullptr);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *data, uint8_t transparent, bool bpp8 = true, uint16_t *cmap = nullptr);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint8_t *data, bool bpp8, uint16_t *cmap = nullptr);
void setSwapBytes(bool swap);
bool getSwapBytes();
void drawBitmap( int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t fgcolor),
drawBitmap( int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t fgcolor, uint16_t bgcolor);
void setPivot(int16_t x, int16_t y);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data, uint16_t transparent);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data, uint16_t transparent);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *data, bool bpp8 = true, uint16_t *cmap = nullptr);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *data, uint8_t transparent, bool bpp8 = true, uint16_t *cmap = nullptr);
void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint8_t *data, bool bpp8, uint16_t *cmap = nullptr);
// Text rendering - value returned is the pixel width of the rendered text
int16_t drawNumber(long intNumber, int32_t x, int32_t y, uint8_t font), // Draw integer using specified font number
@@ -319,18 +307,14 @@ class TFT_eSPI { friend class TFT_eSprite;
drawString(const String& string, int32_t x, int32_t y); // Draw string using current font
// Text rendering and font handling support functions
void setCursor(int16_t x, int16_t y),
void setCursor(int16_t x, int16_t y),
setCursor(int16_t x, int16_t y, uint8_t font);
void setTextColor(uint16_t color), // Set character (glyph) color only (background not over-written)
setTextColor(uint16_t fgcolor, uint16_t bgcolor, bool bgfill = false), // Set character (glyph) foreground and background colour, optional background fill for smooth fonts
setTextSize(uint8_t size); // Set character size multiplier (this increases pixel size)
void setTextColor(uint16_t color), // Set character (glyph) color only (background not over-written)
setTextColor(uint16_t fgcolor, uint16_t bgcolor, bool bgfill = false); // Set character (glyph) foreground and background colour, optional background fill for smooth fonts
void setTextDatum(uint8_t datum); // Set text datum position (default is top left), see Section 5 above
void setTextWrap(bool wrapX, bool wrapY = false); // Turn on/off wrapping of text in TFT width and/or height
void setTextDatum(uint8_t datum); // Set text datum position (default is top left), see Section 5 above
void setTextPadding(uint16_t x_width); // Set text padding (background blanking) width in pixels
void setTextPadding(uint16_t x_width); // Set text padding (background blanking) width in pixels
void setTextFont(uint8_t font); // Set the font number to use in future
int16_t textWidth(const char *string, uint8_t font), // Returns pixel width of string in specified font
@@ -344,9 +328,8 @@ class TFT_eSPI { friend class TFT_eSprite;
uint16_t decodeUTF8(uint8_t *buf, uint16_t *index, uint16_t remaining),
decodeUTF8(uint8_t c);
void spiwrite(uint8_t); // legacy support only
void writecommand(uint8_t c); // Send an 8-bit command, function resets DC/RS high ready for data
void writedata(uint8_t d); // Send data with DC/RS set high
void writecommand(uint8_t c); // Send an 8-bit command, function resets DC/RS high ready for data
void writedata(uint8_t d); // Send data with DC/RS set high
// Colour conversion
// Convert 8-bit red, green and blue to 16 bits
@@ -360,9 +343,7 @@ class TFT_eSPI { friend class TFT_eSprite;
// 16-bit colour alphaBlend with alpha dither (dither reduces colour banding)
uint16_t alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc, uint8_t dither);
uint8_t spiBusyCheck = 0; // Number of ESP32 transfer buffers to check
void writeColor(uint16_t color, uint32_t len); // Deprecated, use pushBlock()
void writeColor(uint16_t color, uint32_t len); // Deprecated, use pushBlock()
// Global variables
uint32_t textcolor, textbgcolor; // Text foreground and background colours
@@ -377,13 +358,13 @@ class TFT_eSPI { friend class TFT_eSprite;
uint8_t decoderState = 0; // UTF8 decoder state - not for user access
uint16_t decoderBuffer; // Unicode code-point buffer - not for user access
void loadFont(const uint8_t array[], uint8_t font);
void unloadFont(uint8_t font);
bool getUnicodeIndex(uint16_t unicode, uint16_t *index, uint16_t font);
void loadFont(const uint8_t array[], uint8_t font);
void unloadFont(uint8_t font);
bool getUnicodeIndex(uint16_t unicode, uint16_t *index, uint16_t font);
virtual void drawGlyph(uint16_t code, uint16_t font);
bool booted;
bool booted;
typedef struct
{
@@ -434,19 +415,9 @@ class TFT_eSPI { friend class TFT_eSprite;
void readAddrWindow(int32_t xs, int32_t ys, int32_t w, int32_t h);
uint8_t readByte();
void busDir(uint32_t mask, uint8_t mode);
void gpioMode(uint8_t gpio, uint8_t mode);
uint8_t sqrt_fraction(uint32_t num);
float wedgeLineDistance(float pax, float pay, float bax, float bay, float dr);
getColorCallback getColor = nullptr; // Smooth font callback function pointer
void loadMetrics(uint8_t font); // Function of Fear, which is Unhandled Exception, writing to 0x000000000
void loadMetrics(uint8_t font); // FoF
uint32_t readInt32();
uint8_t* fontPtr = nullptr;
@@ -454,36 +425,34 @@ class TFT_eSPI { friend class TFT_eSprite;
//-------------------------------------- protected ----------------------------------//
protected:
uint8_t spi_write_speed;
//int32_t win_xe, win_ye; // Window end coords - not needed
uint8_t spi_write_speed;
int32_t _init_width, _init_height; // Display w/h as input, used by setRotation()
int32_t _width, _height; // Display w/h as modified by current rotation
int32_t addr_row, addr_col; // Window position - used to minimise window commands
int32_t _init_width, _init_height; // Display w/h as input, used by setRotation()
int32_t _width, _height; // Display w/h as modified by current rotation
int32_t addr_row, addr_col; // Window position - used to minimise window commands
int16_t _xPivot; // TFT x pivot point coordinate for rotated Sprites
int16_t _yPivot; // TFT x pivot point coordinate for rotated Sprites
int16_t _xPivot; // TFT x pivot point coordinate for rotated Sprites
int16_t _yPivot; // TFT x pivot point coordinate for rotated Sprites
// Viewport variables
int32_t _vpX, _vpY, _vpW, _vpH; // Note: x start, y start, x end + 1, y end + 1
int32_t _xDatum;
int32_t _yDatum;
int32_t _xWidth;
int32_t _yHeight;
bool _vpDatum;
bool _vpOoB;
int32_t _vpX, _vpY, _vpW, _vpH; // Note: x start, y start, x end + 1, y end + 1
int32_t _xDatum;
int32_t _yDatum;
int32_t _xWidth;
int32_t _yHeight;
bool _vpDatum;
bool _vpOoB;
int32_t cursor_x, cursor_y, padX;
int32_t bg_cursor_x;
int32_t last_cursor_x;
int32_t cursor_x, cursor_y, padX;
int32_t bg_cursor_x;
int32_t last_cursor_x;
bool isDigits;
bool textwrapX, textwrapY;
bool _swapBytes;
bool isDigits;
bool textwrapX, textwrapY;
bool _swapBytes;
uint32_t _lastColor;
bool _fillbg;
bool _fillbg;
private:
inline void begin_touch_read_write() __attribute__((always_inline));
@@ -511,9 +480,8 @@ class TFT_eSprite : public TFT_eSPI {
void createPalette(const uint16_t *palette = nullptr, uint8_t colors = 16);
void setPaletteColor(uint8_t index, uint16_t color);
uint16_t getPaletteColor(uint8_t index);
void setBitmapColor(uint16_t fg, uint16_t bg);
void drawPixel(int32_t x, int32_t y, uint32_t color);
void fillSprite(uint32_t color),
void fillSprite(uint32_t color),
setWindow(int32_t x0, int32_t y0, int32_t x1, int32_t y1),
pushColor(uint16_t color),
pushColor(uint16_t color, uint32_t len),
@@ -524,16 +492,16 @@ class TFT_eSprite : public TFT_eSPI {
fillRect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color);
uint16_t readPixel(int32_t x0, int32_t y0);
uint16_t readPixelValue(int32_t x, int32_t y);
void pushImage(int32_t x0, int32_t y0, int32_t w, int32_t h, uint16_t *data, uint8_t sbpp = 0);
void pushImage(int32_t x0, int32_t y0, int32_t w, int32_t h, const uint16_t *data);
void pushSprite(int32_t x, int32_t y);
void pushSprite(int32_t x, int32_t y, uint16_t transparent);
bool pushSprite(int32_t tx, int32_t ty, int32_t sx, int32_t sy, int32_t sw, int32_t sh);
bool pushToSprite(TFT_eSprite *dspr, int32_t x, int32_t y);
bool pushToSprite(TFT_eSprite *dspr, int32_t x, int32_t y, uint16_t transparent);
void pushImage(int32_t x0, int32_t y0, int32_t w, int32_t h, uint16_t *data, uint8_t sbpp = 0);
void pushImage(int32_t x0, int32_t y0, int32_t w, int32_t h, const uint16_t *data);
void pushSprite(int32_t x, int32_t y);
void pushSprite(int32_t x, int32_t y, uint16_t transparent);
bool pushSprite(int32_t tx, int32_t ty, int32_t sx, int32_t sy, int32_t sw, int32_t sh);
bool pushToSprite(TFT_eSprite *dspr, int32_t x, int32_t y);
bool pushToSprite(TFT_eSprite *dspr, int32_t x, int32_t y, uint16_t transparent);
int16_t width(),
height();
void drawGlyph(uint16_t code, uint16_t font);
void drawGlyph(uint16_t code, uint16_t font);
void copyFontFromTFT(uint8_t source, uint8_t destination);
void copyAllFontsFromTFT();
@@ -541,7 +509,7 @@ class TFT_eSprite : public TFT_eSPI {
TFT_eSPI *_tft;
void* callocSprite(int16_t width, int16_t height, uint8_t frames = 1);
void* callocSprite(int16_t width, int16_t height, uint8_t frames = 1);
protected:
@@ -570,8 +538,7 @@ class TFT_eSprite : public TFT_eSPI {
};
template <typename T> static inline void transpose(T& a, T& b) { T t = a; a = b; b = t; }
template <typename A, typename F, typename B> static inline uint16_t fastBlend(A alpha, F fgc, B bgc)
{
template <typename A, typename F, typename B> static inline uint16_t fastBlend(A alpha, F fgc, B bgc) {
// Split out and blend 5-bit red and blue channels
uint32_t rxb = bgc & 0xF81F;
rxb += ((fgc & 0xF81F) - rxb) * (alpha >> 2) >> 6;
+1 -1
View File
@@ -19,7 +19,7 @@ RdsPiBuffer::State RdsPiBuffer::add(uint16_t value, bool error) {
return this->getState(value);
}
void RdsPiBuffer::clear(){
void RdsPiBuffer::clear() {
this->fill = 0;
this->pos = (uint8_t)-1;
}
+156 -166
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -41,9 +41,9 @@ void handleRoot() {
html += "<img src=\"/logo.png\" alt=\"FMDX website\">";
html += "</a>";
html += "<h1>" + String(textUI(283)) + "</h1>";
html += "<button onclick=\"window.location.href='/downloadCSV'\">" + String(textUI(284)) + "</button>";
html += "<button class=\"go-to-bottom\" onclick=\" window.scrollTo(0, document.body.scrollHeight);\">" + String(textUI(286)) + "</button>";
html += "<h1>" + String(textUI(282)) + "</h1>";
html += "<button onclick=\"window.location.href='/downloadCSV'\">" + String(textUI(283)) + "</button>";
html += "<button class=\"go-to-bottom\" onclick=\" window.scrollTo(0, document.body.scrollHeight);\">" + String(textUI(285)) + "</button>";
// Sorting function with icons
html += "<script>";
@@ -143,9 +143,9 @@ void handleRoot() {
}
file.close();
} else html += "<tr><td colspan=\"100%\" style=\"text-align: center; color: red;\">" + String(textUI(296)) + "</td></tr>";
} else html += "<tr><td colspan=\"100%\" style=\"text-align: center; color: red;\">" + String(textUI(295)) + "</td></tr>";
if (!hasData) html += "<tr><td colspan=\"100%\" style=\"text-align: center; color: red;\">" + String(textUI(285)) + "</td></tr>";
if (!hasData) html += "<tr><td colspan=\"100%\" style=\"text-align: center; color: red;\">" + String(textUI(284)) + "</td></tr>";
html += "</table>";
html += "</body></html>";
+28 -22
View File
@@ -274,7 +274,7 @@ void SetTunerPatch() {
radio.getIdentification(&hw, &sw);
TEF = highByte(hw) * 100 + highByte(sw);
tft.fillScreen(BackgroundColor);
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 0, 255));
if(FORBIDDEN_TUNER(TEF)) {
tftPrint(ACENTER, textUI(32), 150, 78, ActiveColor, ActiveColorSmooth, 28);
@@ -327,13 +327,13 @@ void WakeToSleep(bool yes) {
MuteScreen(1);
break;
case LCD_BRIGHTNESS_1_PERCENT:
analogWrite(CONTRASTPIN, map(ContrastSet / 100, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet / 100, 0, 100, 0, 255));
break;
case LCD_BRIGHTNESS_A_QUARTER:
analogWrite(CONTRASTPIN, map(ContrastSet / 4, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet / 4, 0, 100, 0, 255));
break;
case LCD_BRIGHTNESS_HALF:
analogWrite(CONTRASTPIN, map(ContrastSet / 2, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet / 2, 0, 100, 0, 255));
break;
}
} else {
@@ -351,7 +351,7 @@ void WakeToSleep(bool yes) {
screensavertimer = millis();
break;
}
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 0, 255));
}
}
@@ -1167,7 +1167,7 @@ void MuteScreen(bool setting) {
setupmode = true;
leave = true;
tft.writecommand(0x11);
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 0, 255));
if (band < BAND_GAP) {
if (afscreen) {
BuildAFScreen();
@@ -1191,7 +1191,10 @@ void MuteScreen(bool setting) {
setupmode = false;
} else if (setting && !screenmute) {
screenmute = true;
analogWrite(CONTRASTPIN, 0);
for(int x = ContrastSet; x > 0; x--) {
analogWrite(CONTRASTPIN, map(x, 0, 100, 0, 255));
delay(5);
}
tft.writecommand(0x10);
}
}
@@ -1290,7 +1293,7 @@ void later_setup_periph() {
if(fmdeemphasis != DEEMPHASIS_50) radio.setDeemphasis(fmdeemphasis);
if(fmagc != 92) radio.setAGC(fmagc);
if(amagc != 100) radio.setAMAGC(amagc);
if (fmsi) radio.setFMSI(2);
if(fmsi) radio.setFMSI(2);
if(rx_rtc_avail) {
bool reset = init_rtc();
@@ -1316,6 +1319,9 @@ void setup() {
gpio_set_drive_capability((gpio_num_t) 21, GPIO_DRIVE_CAP_0);
gpio_set_drive_capability((gpio_num_t) 22, GPIO_DRIVE_CAP_0);
gpio_set_drive_capability((gpio_num_t) 23, GPIO_DRIVE_CAP_0);
analogWriteFrequency(5000);
EEPROM.begin(EE_TOTAL_CNT);
setupmode = true;
@@ -1441,7 +1447,7 @@ void setup() {
if (rotarymode == 0) rotarymode = 1; else rotarymode = 0;
EEPROM.writeByte(EE_BYTE_ROTARYMODE, rotarymode);
EEPROM.commit();
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 0, 255));
Infoboxprint(textUI(1));
tftPrint(ACENTER, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
while (digitalRead(BWBUTTON) == LOW) delay(50);
@@ -1457,21 +1463,21 @@ void setup() {
}
EEPROM.writeByte(EE_BYTE_DISPLAYFLIP, displayflip);
EEPROM.commit();
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 0, 255));
Infoboxprint(textUI(3));
tftPrint(ACENTER, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
while (digitalRead(MODEBUTTON) == LOW) delay(50);
}
if (digitalRead(BWBUTTON) == HIGH && digitalRead(ROTARY_BUTTON) == HIGH && digitalRead(MODEBUTTON) == HIGH && digitalRead(BANDBUTTON) == LOW) {
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 0, 255));
Infoboxprint(textUI(4));
tftPrint(ACENTER, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
while (digitalRead(BANDBUTTON) == LOW) delay(50);
}
if (digitalRead(BWBUTTON) == LOW && digitalRead(ROTARY_BUTTON) == LOW && digitalRead(MODEBUTTON) == HIGH && digitalRead(BANDBUTTON) == HIGH) {
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 0, 255));
DefaultSettings();
Infoboxprint(textUI(63));
tftPrint(ACENTER, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
@@ -1480,9 +1486,9 @@ void setup() {
}
if (digitalRead(BWBUTTON) == LOW && digitalRead(ROTARY_BUTTON) == HIGH && digitalRead(MODEBUTTON) == LOW && digitalRead(BANDBUTTON) == HIGH) {
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
Infoboxprint(textUI(279));
tftPrint(ACENTER, textUI(280), 155, 100, ActiveColor, ActiveColorSmooth, 28);
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 0, 255));
Infoboxprint(textUI(278));
tftPrint(ACENTER, textUI(279), 155, 100, ActiveColor, ActiveColorSmooth, 28);
tft.calibrateTouch(TouchCalData, PrimaryColor, BackgroundColor, 30);
EEPROM.writeUInt(EE_UINT16_CALTOUCH1, TouchCalData[0]);
EEPROM.writeUInt(EE_UINT16_CALTOUCH2, TouchCalData[1]);
@@ -1493,7 +1499,7 @@ void setup() {
}
if (digitalRead(BWBUTTON) == LOW && digitalRead(ROTARY_BUTTON) == HIGH && digitalRead(MODEBUTTON) == HIGH && digitalRead(BANDBUTTON) == LOW) {
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 0, 255));
Infoboxprint(textUI(66));
tftPrint(ACENTER, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
invertdisplay = !invertdisplay;
@@ -1511,7 +1517,7 @@ void setup() {
tft.drawBitmap((tft.width() - 59) / 2, 24, TEFLogo, 59, 23, ActiveColor);
for (int x = 0; x <= ContrastSet; x++) {
analogWrite(CONTRASTPIN, map(x, 0, 100, 15, 255));
analogWrite(CONTRASTPIN, map(x, 0, 100, 0, 255));
delay(5);
}
@@ -2966,10 +2972,10 @@ void ShowFreq(int mode) {
freqold = freq;
break;
case 1: Infoboxprint(textUI(31)); break;
case 2: Infoboxprint(textUI(287)); break;
case 3: Infoboxprint(textUI(288)); break;
case 4: Infoboxprint(textUI(292)); break;
case 5: Infoboxprint(textUI(281)); break;
case 2: Infoboxprint(textUI(286)); break;
case 3: Infoboxprint(textUI(287)); break;
case 4: Infoboxprint(textUI(291)); break;
case 5: Infoboxprint(textUI(280)); break;
}
FrequencySprite.pushSprite(46, 46);
@@ -3943,7 +3949,7 @@ uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, ui
tft.drawRect(59, 109, 202, 8, FrameColor);
tft.fillRect(60, 110, 200, 6, GreyoutColor);
tftPrint(ARIGHT, textUI(269), 120, 155, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ARIGHT, textUI(268), 120, 155, ActiveColor, ActiveColorSmooth, 16);
for (frequency = startfreq * 10; frequency <= stopfreq * 10; frequency += 10) {
if (stopScanning) break;
+3 -3
View File
@@ -40,7 +40,7 @@ void ShowAdvancedRDS() {
tftPrint16(ALEFT, radio.rds.PTYN.getPrev(), 216, 109, BackgroundColor, BackgroundColor);
}
if (!radio.rds.hasPTYN) radio.rds.PTYN = "PTYN N/A";
tftPrint16(ALEFT, String(radio.rds.PTYN), 216, 109, RDSColor, RDSColorSmooth); // PTYN is UCS-2, meaning no chinese characters. Americans...
tftPrint16(ALEFT, String(radio.rds.PTYN), 216, 109, RDSColor, RDSColorSmooth); // PTYN is UCS-2, meaning no chinese characters. 美国人!
}
}
@@ -83,7 +83,7 @@ void ShowAdvancedRDS() {
if(!screenmute) eonDisplay.update(eonstring, RDSstatus, RDSColor, RDSColorSmooth, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor);
String rtplusstring;
if (radio.rds.hasRTplus) rtplusstring = (radio.rds.rdsplusTag1 != 169 ? String(textUI(radio.rds.rdsplusTag1)) + ": " + String(radio.rds.RTContent1) : "") + (radio.rds.rdsplusTag2 != 169 ? " - " + String(textUI(radio.rds.rdsplusTag2)) + ": " + String(radio.rds.RTContent2) : ""); else rtplusstring = textUI(86);
if (radio.rds.hasRTplus) rtplusstring = (radio.rds.rdsplusTag1 != 166 ? String(textUI(radio.rds.rdsplusTag1)) + ": " + String(radio.rds.RTContent1) : "") + (radio.rds.rdsplusTag2 != 169 ? " - " + String(textUI(radio.rds.rdsplusTag2)) + ": " + String(radio.rds.RTContent2) : ""); else rtplusstring = textUI(86);
if (radio.rds.hasRTplus.changed(0)) {
if (!screenmute) {
if (radio.rds.hasRTplus) tftPrint16(ALEFT, "RT+", 123, 51, RDSColor, RDSColorSmooth); else tftPrint16(ALEFT, "RT+", 123, 51, GreyoutColor, BackgroundColor);
@@ -409,7 +409,7 @@ void showPI() {
void showPTY() {
if(radio.rds.PTY.changed(0)) {
String PTYString = (radio.rds.region != 0 ? (radio.rds.region == 0 ? PTY_EU[radio.rds.PTY] : PTY_USA[radio.rds.PTY]) : textUI(225 + radio.rds.PTY));
String PTYString = (radio.rds.region != 0 ? (radio.rds.region == 0 ? PTY_EU[radio.rds.PTY] : PTY_USA[radio.rds.PTY]) : textUI(224 + radio.rds.PTY));
GeneralTextSprite.fillSprite(TFT_TRANSPARENT);
GeneralTextSprite.fillRect(0, 0, 160, 19, BackgroundColor);
if(RDSstatus) GeneralTextSprite.setTextColor(RDSColor, RDSColorSmooth, false);