You've already forked TEF6686_ESP32
Partially rework fonts (again)
This commit is contained in:
88
src/gui.cpp
88
src/gui.cpp
@@ -480,11 +480,10 @@ void BuildRDSStatScreen() {
|
||||
// Only build screen if not already active
|
||||
if (!rdsstatscreen) {
|
||||
// Set page flags
|
||||
afscreen = false;
|
||||
advancedRDS = false;
|
||||
afscreen = false;
|
||||
advancedRDS = false;
|
||||
rdsstatscreen = true;
|
||||
|
||||
// --- Draw frame and static lines ---
|
||||
tft.fillScreen(BackgroundColor);
|
||||
tft.drawRect(0, 0, 320, 240, FrameColor);
|
||||
tft.drawLine(0, 30, 320, 30, FrameColor);
|
||||
@@ -499,22 +498,18 @@ void BuildRDSStatScreen() {
|
||||
tft.drawLine(160, 50, 160, 218, FrameColor);
|
||||
tft.drawLine(240, 50, 240, 218, FrameColor);
|
||||
|
||||
// --- Column headers ---
|
||||
tftPrint(ALEFT, "kHz", 205, 4, ActiveColor, ActiveColorSmooth, 28);
|
||||
tftPrint(ALEFT, "kHz", 205, 4, ActiveColor, ActiveColorSmooth, 28); // 28, not 16 can't force latin font
|
||||
|
||||
// --- Labels above packet columns ---
|
||||
tftPrint(ALEFT, "ERRORS", 3, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "A:", 66, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "B:", 104, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "C:", 142, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "D:", 180, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "BER", 250, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint16(ALEFT, "ERRORS", 3, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "A:", 66, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "B:", 104, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "C:", 142, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "D:", 180, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "BER", 250, 34, ActiveColor, ActiveColorSmooth);
|
||||
|
||||
// --- Group labels setup ---
|
||||
const uint16_t xcol[4] = {10, 90, 170, 250}; // column X positions
|
||||
const uint16_t rowY[8] = {56, 76, 96, 116, 136, 156, 176, 196}; // row Y positions
|
||||
|
||||
// Labels for each group (A/B)
|
||||
const char* const groups[16][2] = {
|
||||
{"0A", "0B"}, {"1A", "1B"}, {"2A", "2B"}, {"3A", "3B"},
|
||||
{"4A", "4B"}, {"5A", "5B"}, {"6A", "6B"}, {"7A", "7B"},
|
||||
@@ -526,8 +521,8 @@ void BuildRDSStatScreen() {
|
||||
for (uint8_t col = 0; col < 4; col++) { // 4 columns
|
||||
for (uint8_t row = 0; row < 4; row++) { // 4 groups per column
|
||||
uint8_t g = col * 4 + row; // group index 0..15
|
||||
tftPrint(ALEFT, groups[g][0], xcol[col], rowY[row * 2], ActiveColor, ActiveColorSmooth, 16); // A
|
||||
tftPrint(ALEFT, groups[g][1], xcol[col], rowY[row * 2 + 1], ActiveColor, ActiveColorSmooth, 16); // B
|
||||
tftPrint16(ALEFT, groups[g][0], xcol[col], rowY[row * 2], ActiveColor, ActiveColorSmooth); // A
|
||||
tftPrint16(ALEFT, groups[g][1], xcol[col], rowY[row * 2 + 1], ActiveColor, ActiveColorSmooth); // B
|
||||
}
|
||||
}
|
||||
|
||||
@@ -535,8 +530,8 @@ void BuildRDSStatScreen() {
|
||||
const uint16_t pctX[4] = {70, 150, 230, 310};
|
||||
for (uint8_t c = 0; c < 4; c++) {
|
||||
for (uint8_t y = 56; y < 216; y += 20) {
|
||||
tftPrint(ARIGHT, "0.0", pctX[c] - 10, y, GreyoutColor, BackgroundColor, 16); // placeholder value
|
||||
tftPrint(ACENTER, "%", pctX[c], y, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint16(ARIGHT, "0.0", pctX[c] - 10, y, GreyoutColor, BackgroundColor); // placeholder value
|
||||
tftPrint16(ACENTER, "%", pctX[c], y, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2901,30 +2896,29 @@ void BuildAdvancedRDS() {
|
||||
tft.drawLine(210, 30, 210, 193, FrameColor);
|
||||
tft.drawLine(248, 30, 248, 0, FrameColor);
|
||||
|
||||
tftPrint(ALEFT, "ERRORS", 3, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ARIGHT, "MHz", 310, 35, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ARIGHT, unitString[unit], 310, 51, ActiveColor, ActiveColorSmooth, 16);
|
||||
if (radio.rds.region == 0) {
|
||||
tftPrint(ALEFT, "PI", 216, 81, ActiveColor, ActiveColorSmooth, 16);
|
||||
} else {
|
||||
tftPrint(ALEFT, "PI", 216, 72, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "ID", 216, 89, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint16(ALEFT, "ERRORS", 3, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ARIGHT, "MHz", 310, 35, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ARIGHT, unitString[unit], 310, 51, ActiveColor, ActiveColorSmooth);
|
||||
if (radio.rds.region == 0) tftPrint16(ALEFT, "PI", 216, 81, ActiveColor, ActiveColorSmooth);
|
||||
else {
|
||||
tftPrint16(ALEFT, "PI", 216, 72, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "ID", 216, 89, ActiveColor, ActiveColorSmooth);
|
||||
}
|
||||
tftPrint(ALEFT, "PS", 3, 81, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "PTY", 3, 109, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "RT+", 3, 147, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "EON", 3, 174, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "ECC", 3, 199, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "RT", 3, 222, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint16(ALEFT, "PS", 3, 81, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "PTY", 3, 109, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "RT+", 3, 147, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "EON", 3, 174, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "ECC", 3, 199, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "RT", 3, 222, ActiveColor, ActiveColorSmooth);
|
||||
|
||||
tftPrint(ALEFT, "A:", 66, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "B:", 104, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "C:", 142, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "D:", 180, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ARIGHT, "Dynamic PTY", 300, 130, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ARIGHT, "Artificial head", 300, 145, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ARIGHT, "Compressed", 300, 160, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ARIGHT, "Has stereo", 300, 175, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint16(ALEFT, "A:", 66, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "B:", 104, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "C:", 142, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "D:", 180, 34, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ARIGHT, "Dynamic PTY", 300, 130, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ARIGHT, "Artificial head", 300, 145, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ARIGHT, "Compressed", 300, 160, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ARIGHT, "Has stereo", 300, 175, ActiveColor, ActiveColorSmooth);
|
||||
|
||||
tft.fillCircle(86, 41, 5, SignificantColor);
|
||||
tft.fillCircle(124, 41, 5, SignificantColor);
|
||||
@@ -2946,13 +2940,13 @@ void BuildAdvancedRDS() {
|
||||
if (!StereoToggle) tft.drawBitmap(38, 5, Mono, 22, 22, SecondaryColor);
|
||||
else tft.drawBitmap(32, 5, Stereo, 32, 22, GreyoutColor);
|
||||
|
||||
tftPrint(ALEFT, "TP", 2, 51, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "TA", 24, 51, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "AF", 50, 51, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "-B", 68, 51, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "TMC", 88, 51, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "RT+", 123, 51, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "EON", 153, 51, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint16(ALEFT, "TP", 2, 51, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "TA", 24, 51, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "AF", 50, 51, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "-B", 68, 51, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "TMC", 88, 51, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "RT+", 123, 51, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "EON", 153, 51, GreyoutColor, BackgroundColor);
|
||||
|
||||
RDSstatusold = !RDSstatusold;
|
||||
ShowFreq(0);
|
||||
|
||||
241
src/main.cpp
241
src/main.cpp
@@ -21,6 +21,7 @@ using fs::FS;
|
||||
#include "nonvolatile.h"
|
||||
#include "utils.h"
|
||||
#include "system_console.h"
|
||||
#include "main.h"
|
||||
#pragma endregion
|
||||
|
||||
Console console(&tft);
|
||||
@@ -261,8 +262,8 @@ void updateSWMIBand() {
|
||||
|
||||
inline void updateCodetect() {
|
||||
if (band > BAND_GAP) {
|
||||
if (WAM) tftPrint(ALEFT, "CO", 50, 61, PrimaryColor, PrimaryColorSmooth, 16);
|
||||
else tftPrint(ALEFT, "CO", 50, 61, BackgroundColor, BackgroundColor, 16);
|
||||
if (WAM) tftPrint16(ALEFT, "CO", 50, 61, PrimaryColor, PrimaryColorSmooth);
|
||||
else tftPrint16(ALEFT, "CO", 50, 61, BackgroundColor, BackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -718,13 +719,13 @@ void updateBW() {
|
||||
if (BWset == 0) {
|
||||
if (!BWtune && !screenmute && !advancedRDS && !afscreen && !rdsstatscreen) {
|
||||
tft.fillRoundRect(248, 36, 69, 18, 2, SecondaryColor);
|
||||
tftPrint(ACENTER, "AUTO BW", 282, 38, BackgroundColor, SecondaryColor, 16);
|
||||
tftPrint16(ACENTER, "AUTO BW", 282, 38, BackgroundColor, SecondaryColor);
|
||||
}
|
||||
radio.setFMABandw();
|
||||
} else {
|
||||
if (!BWtune && !screenmute && !advancedRDS && !afscreen && !rdsstatscreen) {
|
||||
tft.fillRoundRect(248, 36, 69, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "AUTO BW", 282, 38, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "AUTO BW", 282, 38, BackgroundColor, GreyoutColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -734,13 +735,13 @@ void updateiMS() {
|
||||
if (iMSset == 0) {
|
||||
if (!screenmute && !advancedRDS && !afscreen && !rdsstatscreen && !BWtune) {
|
||||
tft.fillRoundRect(249, 57, 30, 18, 2, SecondaryColor);
|
||||
tftPrint(ACENTER, "iMS", 265, 59, BackgroundColor, SecondaryColor, 16);
|
||||
tftPrint16(ACENTER, "iMS", 265, 59, BackgroundColor, SecondaryColor);
|
||||
}
|
||||
radio.setiMS(1);
|
||||
} else {
|
||||
if (!screenmute && !advancedRDS && !afscreen && !rdsstatscreen && !BWtune) {
|
||||
tft.fillRoundRect(249, 57, 30, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "iMS", 265, 59, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "iMS", 265, 59, BackgroundColor, GreyoutColor);
|
||||
}
|
||||
radio.setiMS(0);
|
||||
}
|
||||
@@ -752,13 +753,13 @@ void updateEQ() {
|
||||
if (EQset == 0) {
|
||||
if (!screenmute && !advancedRDS && !afscreen && !rdsstatscreen && !BWtune) {
|
||||
tft.fillRoundRect(287, 57, 30, 18, 2, SecondaryColor);
|
||||
tftPrint(ACENTER, "EQ", 301, 59, BackgroundColor, SecondaryColor, 16);
|
||||
tftPrint16(ACENTER, "EQ", 301, 59, BackgroundColor, SecondaryColor);
|
||||
}
|
||||
radio.setEQ(1);
|
||||
} else {
|
||||
if (!screenmute && !advancedRDS && !afscreen && !rdsstatscreen && !BWtune) {
|
||||
tft.fillRoundRect(287, 57, 30, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "EQ", 301, 59, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "EQ", 301, 59, BackgroundColor, GreyoutColor);
|
||||
}
|
||||
radio.setEQ(0);
|
||||
}
|
||||
@@ -1149,7 +1150,7 @@ void cancelDXScan() {
|
||||
|
||||
if (!flashing) {
|
||||
tft.fillRoundRect(2, 80, 40, 18, 2, SecondaryColor);
|
||||
tftPrint(ACENTER, "MEM", 22, 82, BackgroundColor, SecondaryColor, 16);
|
||||
tftPrint16(ACENTER, "MEM", 22, 82, BackgroundColor, SecondaryColor);
|
||||
}
|
||||
|
||||
SQ = false;
|
||||
@@ -1379,7 +1380,11 @@ void setup() {
|
||||
|
||||
tft.init();
|
||||
|
||||
tft.loadFont(FONT48, 2);
|
||||
tft.loadFont(FONT16_CHS, 0);
|
||||
tft.loadFont(FONT48, 1);
|
||||
tft.loadFont(FONT16, 2);
|
||||
tft.loadFont(FONT28, 3);
|
||||
tft.loadFont(FONT28_CHS, 4);
|
||||
|
||||
doTheme();
|
||||
|
||||
@@ -1413,13 +1418,13 @@ void setup() {
|
||||
FrequencySprite.loadFont(FREQFONT5, 5);
|
||||
|
||||
GeneralTextSprite.createSprite(308, 28);
|
||||
GeneralTextSprite.loadFont(FONT48, 2);
|
||||
GeneralTextSprite.copyFontFromTFT(2, 2);
|
||||
|
||||
PSSprite.createSprite(150, 32);
|
||||
PSSprite.loadFont(FONT16, 0);
|
||||
PSSprite.loadFont(FONT16_CHS, 1);
|
||||
PSSprite.loadFont(FONT28, 2);
|
||||
PSSprite.loadFont(FONT28_CHS, 3);
|
||||
PSSprite.copyFontFromTFT(2, 0);
|
||||
PSSprite.copyFontFromTFT(0, 1);
|
||||
PSSprite.copyFontFromTFT(3, 2);
|
||||
PSSprite.copyFontFromTFT(4, 3);
|
||||
|
||||
SquelchSprite.createSprite(27, 19);
|
||||
|
||||
@@ -1428,7 +1433,7 @@ void setup() {
|
||||
OneBigLineSprite.createSprite(270, 30);
|
||||
|
||||
SignalSprite.createSprite(80, 48);
|
||||
SignalSprite.loadFont(FONT28, 0);
|
||||
SignalSprite.copyFontFromTFT(4, 0);
|
||||
SignalSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
|
||||
|
||||
UpdateFonts();
|
||||
@@ -1549,11 +1554,11 @@ void setup() {
|
||||
SelectBand();
|
||||
if (tunemode == TUNE_MEM) DoMemoryPosTune();
|
||||
|
||||
eccDisplay.setPostDrawCallback([&](TFT_eSprite* sprite, bool scrolling) {
|
||||
eccDisplay.setPostDrawCallback([&](TFT_eSprite* sprite) {
|
||||
sprite->fillRect(275, 0, 10, 19, BackgroundColor);
|
||||
sprite->drawLine(284, 0, 284, 19, FrameColor);
|
||||
});
|
||||
rtDisplay.setPostDrawCallback([&](TFT_eSprite* sprite, bool scrolling) {
|
||||
rtDisplay.setPostDrawCallback([&](TFT_eSprite* sprite) {
|
||||
sprite->fillRect(275, 0, 10, 19, BackgroundColor);
|
||||
sprite->drawLine(284, 0, 284, 19, FrameColor);
|
||||
if(radio.rds.hasRT) {
|
||||
@@ -1678,10 +1683,10 @@ void loop() {
|
||||
flashing = !flashing;
|
||||
if (flashing) {
|
||||
tft.fillRoundRect(2, 80, 40, 18, 2, SecondaryColor);
|
||||
tftPrint(ACENTER, "MEM", 22, 82, BackgroundColor, SecondaryColor, 16);
|
||||
tftPrint16(ACENTER, "MEM", 22, 82, BackgroundColor, SecondaryColor);
|
||||
} else {
|
||||
tft.fillRoundRect(2, 80, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "MEM", 22, 82, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "MEM", 22, 82, BackgroundColor, GreyoutColor);
|
||||
}
|
||||
flashingtimer = millis();
|
||||
}
|
||||
@@ -1825,12 +1830,12 @@ void loop() {
|
||||
if ((SStatus / 10 > LowLevelSet) && !LowLevelInit && !BWtune && !menu && band < BAND_GAP) {
|
||||
if (!screenmute && !advancedRDS && !rdsstatscreen && !afscreen) {
|
||||
if (showaudio) {
|
||||
tftPrint(ALEFT, "10", 24, 144, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "30", 54, 144, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "50", 84, 144, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "70", 114, 144, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "100", 160, 144, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ACENTER, "A", 7, 128, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint16(ALEFT, "10", 24, 144, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "30", 54, 144, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "50", 84, 144, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "70", 114, 144, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "100", 160, 144, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ACENTER, "A", 7, 128, ActiveColor, ActiveColorSmooth);
|
||||
for (byte segments = 0; segments < 93; segments++) {
|
||||
if (segments > 54) {
|
||||
if (((segments - 53) % 10) == 0) tft.fillRect(22 + (2 * segments), 141, 2, 2, BarSignificantColor);
|
||||
@@ -1839,14 +1844,14 @@ void loop() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (radio.rds.region == 0) tftPrint(ALEFT, "PI", 212, 193, ActiveColor, ActiveColorSmooth, 16);
|
||||
if (radio.rds.region == 0) tftPrint16(ALEFT, "PI", 212, 193, ActiveColor, ActiveColorSmooth);
|
||||
else {
|
||||
tftPrint(ALEFT, "PI", 212, 184, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "ID", 212, 201, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint16(ALEFT, "PI", 212, 184, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "ID", 212, 201, ActiveColor, ActiveColorSmooth);
|
||||
}
|
||||
tftPrint(ALEFT, "PS", 3, 193, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "RT", 3, 221, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "PTY", 3, 163, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint16(ALEFT, "PS", 3, 193, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "RT", 3, 221, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "PTY", 3, 163, ActiveColor, ActiveColorSmooth);
|
||||
if (!showaudio) tft.drawLine(16, 143, 189, 143, GreyoutColor); else tft.drawLine(16, 143, 189, 143, ActiveColor);
|
||||
}
|
||||
LowLevelInit = true;
|
||||
@@ -1856,12 +1861,12 @@ void loop() {
|
||||
if (LowLevelInit && !BWtune && !menu) {
|
||||
if (!screenmute && !rdsstatscreen && !afscreen && !advancedRDS) {
|
||||
if(showaudio) {
|
||||
tftPrint(ALEFT, "10", 24, 144, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "30", 54, 144, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "50", 84, 144, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "70", 114, 144, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "100", 160, 144, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ACENTER, "A", 7, 128, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint16(ALEFT, "10", 24, 144, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "30", 54, 144, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "50", 84, 144, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "70", 114, 144, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "100", 160, 144, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ACENTER, "A", 7, 128, GreyoutColor, BackgroundColor);
|
||||
tft.fillRect(16, 133, 174, 6, GreyoutColor);
|
||||
for (byte segments = 0; segments < 93; segments++) {
|
||||
if (segments > 54) {
|
||||
@@ -1871,14 +1876,14 @@ void loop() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (radio.rds.region == 0) tftPrint(ALEFT, "PI", 212, 193, GreyoutColor, BackgroundColor, 16);
|
||||
if (radio.rds.region == 0) tftPrint16(ALEFT, "PI", 212, 193, GreyoutColor, BackgroundColor);
|
||||
else {
|
||||
tftPrint(ALEFT, "PI", 212, 184, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "ID", 212, 201, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint16(ALEFT, "PI", 212, 184, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "ID", 212, 201, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
tftPrint(ALEFT, "PS", 3, 193, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "RT", 3, 221, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "PTY", 3, 163, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint16(ALEFT, "PS", 3, 193, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "RT", 3, 221, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "PTY", 3, 163, GreyoutColor, BackgroundColor);
|
||||
tft.drawLine(16, 143, 189, 143, GreyoutColor);
|
||||
tft.drawBitmap(68, 5, RDSLogo, 35, 22, GreyoutColor);
|
||||
}
|
||||
@@ -2356,20 +2361,20 @@ void SelectBand() {
|
||||
radio.setAMCoChannel(amcodect, amcodectcount);
|
||||
doBW();
|
||||
if (!screenmute) {
|
||||
if (radio.rds.region == 0) tftPrint(ALEFT, "PI", 212, 193, GreyoutColor, BackgroundColor, 16);
|
||||
if (radio.rds.region == 0) tftPrint16(ALEFT, "PI", 212, 193, GreyoutColor, BackgroundColor);
|
||||
else {
|
||||
tftPrint(ALEFT, "PI", 212, 184, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "ID", 212, 201, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint16(ALEFT, "PI", 212, 184, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "ID", 212, 201, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
|
||||
tftPrint(ALEFT, "PS", 3, 193, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "RT", 3, 221, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, "PTY", 3, 163, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint16(ALEFT, "PS", 3, 193, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "RT", 3, 221, GreyoutColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, "PTY", 3, 163, GreyoutColor, BackgroundColor);
|
||||
tft.drawBitmap(68, 5, RDSLogo, 35, 22, GreyoutColor);
|
||||
tft.fillRoundRect(249, 57, 30, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "iMS", 265, 59, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "iMS", 265, 59, BackgroundColor, GreyoutColor);
|
||||
tft.fillRoundRect(287, 57, 30, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "EQ", 301, 59, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "EQ", 301, 59, BackgroundColor, GreyoutColor);
|
||||
tftReplace(ALEFT, "MHz", "kHz", 258, 76, ActiveColor, ActiveColorSmooth, BackgroundColor, 28);
|
||||
}
|
||||
} else {
|
||||
@@ -2385,14 +2390,14 @@ void SelectBand() {
|
||||
freqold = frequency_AM;
|
||||
if (!externaltune && tunemode != TUNE_MEM) CheckBandForbiddenFM();
|
||||
doBW();
|
||||
if (radio.rds.region == 0) tftPrint(ALEFT, "PI", 212, 193, ActiveColor, ActiveColorSmooth, 16);
|
||||
if (radio.rds.region == 0) tftPrint16(ALEFT, "PI", 212, 193, ActiveColor, ActiveColorSmooth);
|
||||
else {
|
||||
tftPrint(ALEFT, "PI", 212, 184, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "ID", 212, 201, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint16(ALEFT, "PI", 212, 184, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "ID", 212, 201, ActiveColor, ActiveColorSmooth);
|
||||
}
|
||||
tftPrint(ALEFT, "PS", 3, 193, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "RT", 3, 221, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "PTY", 3, 163, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint16(ALEFT, "PS", 3, 193, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "RT", 3, 221, ActiveColor, ActiveColorSmooth);
|
||||
tftPrint16(ALEFT, "PTY", 3, 163, ActiveColor, ActiveColorSmooth);
|
||||
|
||||
tftReplace(ALEFT, "kHz", "MHz", 258, 76, ActiveColor, ActiveColorSmooth, BackgroundColor, 28);
|
||||
}
|
||||
@@ -2625,8 +2630,8 @@ void ButtonPress() {
|
||||
EEPROM.writeByte(EE_BYTE_BANDAUTOSW, nowToggleSWMIBand);
|
||||
EEPROM.commit();
|
||||
if (!screenmute) {
|
||||
tftPrint(ACENTER, "AUTO", 22, 60, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(ACENTER, "BAND", 22, 60, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint16(ACENTER, "AUTO", 22, 60, BackgroundColor, BackgroundColor);
|
||||
tftPrint16(ACENTER, "BAND", 22, 60, BackgroundColor, BackgroundColor);
|
||||
}
|
||||
doTuneMode();
|
||||
ShowTuneMode();
|
||||
@@ -2820,8 +2825,8 @@ void ShowMemoryPos() {
|
||||
else tftReplace(ALEFT, String(memoryposold + 1), String(memorypos + 1), 50, 32, memposcolor, memposcolorsmooth, BackgroundColor, 16);
|
||||
memoryposold = memorypos;
|
||||
} else {
|
||||
if (advancedRDS) tftPrint(ALEFT, String(memorypos + 1), 215, 36, BackgroundColor, BackgroundColor, 16);
|
||||
else tftPrint(ALEFT, String(memorypos + 1), 50, 32, BackgroundColor, BackgroundColor, 16);
|
||||
if (advancedRDS) tftPrint16(ALEFT, String(memorypos + 1), 215, 36, BackgroundColor, BackgroundColor);
|
||||
else tftPrint16(ALEFT, String(memorypos + 1), 50, 32, BackgroundColor, BackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3029,12 +3034,12 @@ void ShowSignalLevel() {
|
||||
SNRupdatetimer = millis();
|
||||
if (!advancedRDS) {
|
||||
if (CN > (CNold + 1) || CN < (CNold - 1)) {
|
||||
if (CNold == 0) tftPrint(ARIGHT, "--", 234, 165, BackgroundColor, BackgroundColor, 16); else tftPrint(ARIGHT, String(CNold), 234, 165, BackgroundColor, BackgroundColor, 16);
|
||||
if (CNold == 0) tftPrint16(ARIGHT, "--", 234, 165, BackgroundColor, BackgroundColor); else tftPrint16(ARIGHT, String(CNold), 234, 165, BackgroundColor, BackgroundColor);
|
||||
if (tuned) {
|
||||
if (CN == 0) tftPrint(ARIGHT, "--", 234, 165, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(ARIGHT, String(CN), 234, 165, PrimaryColor, PrimaryColorSmooth, 16);
|
||||
if (CN == 0) tftPrint16(ARIGHT, "--", 234, 165, PrimaryColor, PrimaryColorSmooth); else tftPrint16(ARIGHT, String(CN), 234, 165, PrimaryColor, PrimaryColorSmooth);
|
||||
CNold = CN;
|
||||
} else {
|
||||
tftPrint(ARIGHT, "--", 234, 165, PrimaryColor, PrimaryColorSmooth, 16);
|
||||
tftPrint16(ARIGHT, "--", 234, 165, PrimaryColor, PrimaryColorSmooth);
|
||||
CNold = 0;
|
||||
}
|
||||
}
|
||||
@@ -3475,67 +3480,67 @@ void ShowTuneMode() {
|
||||
switch (tunemode) {
|
||||
case TUNE_MAN:
|
||||
if (band == BAND_SW && nowToggleSWMIBand) {
|
||||
tftPrint(ACENTER, "AUTO", 22, 60, GreyoutColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "AUTO", 22, 60, GreyoutColor, GreyoutColor);
|
||||
tft.fillRoundRect(2, 58, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "BAND", 22, 60, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "BAND", 22, 60, BackgroundColor, GreyoutColor);
|
||||
} else {
|
||||
tftPrint(ACENTER, "BAND", 22, 60, GreyoutColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "BAND", 22, 60, GreyoutColor, GreyoutColor);
|
||||
tft.fillRoundRect(2, 58, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "AUTO", 22, 60, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "AUTO", 22, 60, BackgroundColor, GreyoutColor);
|
||||
}
|
||||
|
||||
tft.fillRoundRect(2, 36, 40, 18, 2, SecondaryColor);
|
||||
tftPrint(ACENTER, "MAN", 22, 38, BackgroundColor, SecondaryColor, 16);
|
||||
tftPrint16(ACENTER, "MAN", 22, 38, BackgroundColor, SecondaryColor);
|
||||
|
||||
tft.fillRoundRect(2, 80, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "MEM", 22, 82, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "MEM", 22, 82, BackgroundColor, GreyoutColor);
|
||||
break;
|
||||
|
||||
case TUNE_AUTO:
|
||||
tft.fillRoundRect(2, 58, 40, 18, 2, SecondaryColor);
|
||||
tftPrint(ACENTER, "AUTO", 22, 60, BackgroundColor, SecondaryColor, 16);
|
||||
tftPrint16(ACENTER, "AUTO", 22, 60, BackgroundColor, SecondaryColor);
|
||||
|
||||
tft.fillRoundRect(2, 36, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "MAN", 22, 38, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "MAN", 22, 38, BackgroundColor, GreyoutColor);
|
||||
|
||||
tft.fillRoundRect(2, 80, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "MEM", 22, 82, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "MEM", 22, 82, BackgroundColor, GreyoutColor);
|
||||
break;
|
||||
|
||||
case TUNE_MEM:
|
||||
if (band == BAND_SW && nowToggleSWMIBand) {
|
||||
tftPrint(ACENTER, "AUTO", 22, 60, GreyoutColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "AUTO", 22, 60, GreyoutColor, GreyoutColor);
|
||||
|
||||
tft.fillRoundRect(2, 58, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "BAND", 22, 60, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "BAND", 22, 60, BackgroundColor, GreyoutColor);
|
||||
} else {
|
||||
tftPrint(ACENTER, "BAND", 22, 60, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "BAND", 22, 60, BackgroundColor, GreyoutColor);
|
||||
|
||||
tft.fillRoundRect(2, 58, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "AUTO", 22, 60, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "AUTO", 22, 60, BackgroundColor, GreyoutColor);
|
||||
}
|
||||
|
||||
tft.fillRoundRect(2, 36, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "MAN", 22, 38, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "MAN", 22, 38, BackgroundColor, GreyoutColor);
|
||||
|
||||
if (memorystore) {
|
||||
tft.fillRoundRect(2, 80, 40, 18, 2, SignificantColor);
|
||||
tftPrint(ACENTER, "MEM", 22, 82, BackgroundColor, SignificantColor, 16);
|
||||
tftPrint16(ACENTER, "MEM", 22, 82, BackgroundColor, SignificantColor);
|
||||
} else {
|
||||
tft.fillRoundRect(2, 80, 40, 18, 2, SecondaryColor);
|
||||
tftPrint(ACENTER, "MEM", 22, 82, BackgroundColor, SecondaryColor, 16);
|
||||
tftPrint16(ACENTER, "MEM", 22, 82, BackgroundColor, SecondaryColor);
|
||||
}
|
||||
break;
|
||||
|
||||
case TUNE_MI_BAND:
|
||||
tft.fillRoundRect(2, 58, 40, 18, 2, SecondaryColor);
|
||||
tftPrint(ACENTER, "BAND", 22, 60, BackgroundColor, SecondaryColor, 16);
|
||||
tftPrint16(ACENTER, "BAND", 22, 60, BackgroundColor, SecondaryColor);
|
||||
|
||||
tft.fillRoundRect(2, 36, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "MAN", 22, 38, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "MAN", 22, 38, BackgroundColor, GreyoutColor);
|
||||
|
||||
tft.fillRoundRect(2, 80, 40, 18, 2, GreyoutColor);
|
||||
tftPrint(ACENTER, "MEM", 22, 82, BackgroundColor, GreyoutColor, 16);
|
||||
tftPrint16(ACENTER, "MEM", 22, 82, BackgroundColor, GreyoutColor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3841,9 +3846,9 @@ void read_encoder() {
|
||||
}
|
||||
|
||||
void tftReplace(int8_t offset, const String & textold, const String & text, int16_t x, int16_t y, int color, int smoothcolor, int background, uint8_t fontsize) {
|
||||
uint8_t selectedFont = 0;
|
||||
if (fontsize == 28) selectedFont = 1;
|
||||
else if (fontsize == 48) selectedFont = 2;
|
||||
uint8_t selectedFont = 0 ? (language == LANGUAGE_CHS) : 2;
|
||||
if(fontsize == 28) selectedFont = (language == LANGUAGE_CHS) ? 4 : 3;
|
||||
else if(fontsize == 48) selectedFont = 1;
|
||||
|
||||
switch (offset) {
|
||||
case -1: tft.setTextDatum(TL_DATUM); break;
|
||||
@@ -3862,11 +3867,29 @@ void tftReplace(int8_t offset, const String & textold, const String & text, int1
|
||||
}
|
||||
|
||||
void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int color, int smoothcolor, uint8_t fontsize) {
|
||||
uint8_t selectedFont = 0;
|
||||
if (fontsize == 28) selectedFont = 1;
|
||||
else if (fontsize == 48) selectedFont = 2;
|
||||
uint8_t selectedFont = (language == LANGUAGE_CHS) ? 0 : 2;
|
||||
if (fontsize == 28) selectedFont = (language == LANGUAGE_CHS) ? 4 : 3;
|
||||
else if (fontsize == 48) selectedFont = 1;
|
||||
|
||||
tft.setTextColor(color, smoothcolor, (fontsize == 52 ? true : false));
|
||||
tft.setTextColor(color, smoothcolor);
|
||||
|
||||
switch (offset) {
|
||||
case -1: tft.setTextDatum(TL_DATUM); break;
|
||||
case 0: tft.setTextDatum(TC_DATUM); break;
|
||||
case 1: tft.setTextDatum(TR_DATUM); break;
|
||||
}
|
||||
|
||||
String modifiedText = text;
|
||||
modifiedText.replace("\n", " ");
|
||||
|
||||
tft.drawString(modifiedText, x, y, selectedFont);
|
||||
}
|
||||
|
||||
void tftPrint16(int8_t offset, const String & text, int16_t x, int16_t y, int color, int smoothcolor, bool force_font, bool font) {
|
||||
uint8_t selectedFont = (language == LANGUAGE_CHS) ? 0 : 2;
|
||||
if(force_font) selectedFont = 0 ? font : 2;
|
||||
|
||||
tft.setTextColor(color, smoothcolor);
|
||||
|
||||
switch (offset) {
|
||||
case -1: tft.setTextDatum(TL_DATUM); break;
|
||||
@@ -3881,26 +3904,30 @@ void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int colo
|
||||
}
|
||||
|
||||
void UpdateFonts() {
|
||||
// This is at setup:
|
||||
// tft.loadFont(FONT48, 1);
|
||||
|
||||
// tft.loadFont(FONT16_CHS, 0);
|
||||
// tft.loadFont(FONT16, 2);
|
||||
// tft.loadFont(FONT28, 3);
|
||||
// tft.loadFont(FONT28_CHS, 4);
|
||||
|
||||
if (language == LANGUAGE_CHS) {
|
||||
if (menu) PSSprite.setTextFont(1); else PSSprite.setTextFont(3);
|
||||
OneBigLineSprite.loadFont(FONT28_CHS, 0);
|
||||
FullLineSprite.loadFont(FONT16_CHS, 0);
|
||||
GeneralTextSprite.loadFont(FONT16_CHS, 0);
|
||||
GeneralTextSprite.loadFont(FONT28_CHS, 1);
|
||||
FrequencySprite.loadFont(FONT16_CHS, 6);
|
||||
tft.loadFont(FONT16_CHS, 0);
|
||||
tft.loadFont(FONT28_CHS, 1);
|
||||
SquelchSprite.loadFont(FONT16, 0);
|
||||
OneBigLineSprite.copyFontFromTFT(4, 0);
|
||||
FullLineSprite.copyFontFromTFT(0, 0);
|
||||
GeneralTextSprite.copyFontFromTFT(0, 0);
|
||||
GeneralTextSprite.copyFontFromTFT(4, 1);
|
||||
FrequencySprite.copyFontFromTFT(0, 6);
|
||||
SquelchSprite.copyFontFromTFT(0, 0);
|
||||
} else {
|
||||
if (menu) PSSprite.setTextFont(0); else PSSprite.setTextFont(2);
|
||||
OneBigLineSprite.loadFont(FONT28, 0);
|
||||
FullLineSprite.loadFont(FONT16, 0);
|
||||
GeneralTextSprite.loadFont(FONT16, 0);
|
||||
GeneralTextSprite.loadFont(FONT28, 1);
|
||||
FrequencySprite.loadFont(FONT16, 6);
|
||||
tft.loadFont(FONT16, 0);
|
||||
tft.loadFont(FONT28, 1);
|
||||
SquelchSprite.loadFont(FONT16_CHS, 0);
|
||||
OneBigLineSprite.copyFontFromTFT(3, 0);
|
||||
FullLineSprite.copyFontFromTFT(2, 0);
|
||||
GeneralTextSprite.copyFontFromTFT(2, 0);
|
||||
GeneralTextSprite.copyFontFromTFT(3, 1);
|
||||
FrequencySprite.copyFontFromTFT(2, 6);
|
||||
SquelchSprite.copyFontFromTFT(2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
34
src/rds.cpp
34
src/rds.cpp
@@ -36,17 +36,17 @@ void ShowAdvancedRDS() {
|
||||
if (radio.rds.PTYN.changed(0) || rdsreset) {
|
||||
if (!screenmute) {
|
||||
if (radio.rds.PTYN.getPrev() != "PTYN N/A" || radio.rds.hasPTYN) {
|
||||
tftPrint(ALEFT, "PTYN N/A", 216, 109, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, radio.rds.PTYN.getPrev(), 216, 109, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint16(ALEFT, "PTYN N/A", 216, 109, BackgroundColor, BackgroundColor);
|
||||
tftPrint16(ALEFT, radio.rds.PTYN.getPrev(), 216, 109, BackgroundColor, BackgroundColor);
|
||||
}
|
||||
if (!radio.rds.hasPTYN) radio.rds.PTYN = "PTYN N/A";
|
||||
tftPrint(ALEFT, String(radio.rds.PTYN), 216, 109, RDSColor, RDSColorSmooth, 16);
|
||||
tftPrint16(ALEFT, String(radio.rds.PTYN), 216, 109, RDSColor, RDSColorSmooth); // PTYN is UCS-2, meaning no chinese characters. Americans...
|
||||
}
|
||||
}
|
||||
|
||||
if (hasafold != radio.rds.hasAF) {
|
||||
if (!screenmute) {
|
||||
if (radio.rds.hasAF) tftPrint(ALEFT, "AF", 50, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(ALEFT, "AF", 50, 51, GreyoutColor, BackgroundColor, 16);
|
||||
if (radio.rds.hasAF) tftPrint16(ALEFT, "AF", 50, 51, RDSColor, RDSColorSmooth); else tftPrint16(ALEFT, "AF", 50, 51, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
hasafold = radio.rds.hasAF;
|
||||
}
|
||||
@@ -64,13 +64,19 @@ void ShowAdvancedRDS() {
|
||||
Udp.endPacket();
|
||||
}
|
||||
}
|
||||
if(!screenmute) eccDisplay.update(ECCString, RDSstatus, RDSColor, RDSColorSmooth, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor);
|
||||
if(!screenmute) {
|
||||
uint8_t font = 0;
|
||||
if(radio.rds.ECC.get() == 190) font = 1;
|
||||
else if(radio.rds.ECC.get() == 192) font = 1;
|
||||
else if(radio.rds.ECC.get() == 201) font = 1;
|
||||
eccDisplay.update(ECCString, RDSstatus, RDSColor, RDSColorSmooth, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, font);
|
||||
}
|
||||
|
||||
String eonstring;
|
||||
if (radio.eon_counter > 0) for (byte i = 0; i < radio.eon_counter; i++) eonstring += String(radio.eon[i].picode) + (radio.eon[i].ps.length() > 0 ? String(": " + String(radio.eon[i].ps)) : "") + (radio.eon[i].mappedfreq > 0 ? String(" " + String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10)) : "") + (radio.eon[i].mappedfreq2 > 0 ? String(" / " + String(radio.eon[i].mappedfreq2 / 100) + "." + String((radio.eon[i].mappedfreq2 % 100) / 10)) : "") + (radio.eon[i].mappedfreq3 > 0 ? String(" / " + String(radio.eon[i].mappedfreq3 / 100) + "." + String((radio.eon[i].mappedfreq3 % 100) / 10)) : "") + (i == radio.eon_counter - 1 ? "" : " | "); else eonstring = textUI(85);
|
||||
if (radio.rds.hasEON.changed(0)) {
|
||||
if (!screenmute) {
|
||||
if (radio.eon_counter > 0) tftPrint(ALEFT, "EON", 153, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(ALEFT, "EON", 153, 51, GreyoutColor, BackgroundColor, 16);
|
||||
if (radio.eon_counter > 0) tftPrint16(ALEFT, "EON", 153, 51, RDSColor, RDSColorSmooth); else tftPrint16(ALEFT, "EON", 153, 51, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,23 +86,23 @@ void ShowAdvancedRDS() {
|
||||
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.changed(0)) {
|
||||
if (!screenmute) {
|
||||
if (radio.rds.hasRTplus) tftPrint(ALEFT, "RT+", 123, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(ALEFT, "RT+", 123, 51, GreyoutColor, BackgroundColor, 16);
|
||||
if (radio.rds.hasRTplus) tftPrint16(ALEFT, "RT+", 123, 51, RDSColor, RDSColorSmooth); else tftPrint16(ALEFT, "RT+", 123, 51, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
if(!screenmute) rtplusDisplay.update(rtplusstring, RDSstatus, RDSColor, RDSColorSmooth, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor);
|
||||
|
||||
if (radio.rds.TP.changed(0) && !screenmute) {
|
||||
if (radio.rds.TP) tftPrint(ALEFT, "TP", 2, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(ALEFT, "TP", 2, 51, GreyoutColor, BackgroundColor, 16);
|
||||
if (radio.rds.TP) tftPrint16(ALEFT, "TP", 2, 51, RDSColor, RDSColorSmooth); else tftPrint16(ALEFT, "TP", 2, 51, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
|
||||
if (radio.rds.TA.changed(0) && !screenmute) {
|
||||
if (radio.rds.TA) tftPrint(ALEFT, "TA", 24, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(ALEFT, "TA", 24, 51, GreyoutColor, BackgroundColor, 16);
|
||||
if (radio.rds.TA) tftPrint16(ALEFT, "TA", 24, 51, RDSColor, RDSColorSmooth); else tftPrint16(ALEFT, "TA", 24, 51, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
|
||||
if (afmethodBold != radio.afmethodB || rdsreset) {
|
||||
if (!screenmute) {
|
||||
if (radio.afmethodB) tftPrint(ALEFT, "-B", 68, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(ALEFT, "-B", 68, 51, GreyoutColor, BackgroundColor, 16);
|
||||
if (radio.afmethodB) tftPrint16(ALEFT, "-B", 68, 51, RDSColor, RDSColorSmooth); else tftPrint16(ALEFT, "-B", 68, 51, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
afmethodBold = radio.afmethodB;
|
||||
}
|
||||
@@ -109,7 +115,7 @@ void ShowAdvancedRDS() {
|
||||
|
||||
if (radio.rds.hasTMC.changed(0)) {
|
||||
if (!screenmute) {
|
||||
if (radio.rds.hasTMC) tftPrint(ALEFT, "TMC", 88, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(ALEFT, "TMC", 88, 51, GreyoutColor, BackgroundColor, 16);
|
||||
if (radio.rds.hasTMC) tftPrint16(ALEFT, "TMC", 88, 51, RDSColor, RDSColorSmooth); else tftPrint16(ALEFT, "TMC", 88, 51, GreyoutColor, BackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +158,7 @@ void readRds() {
|
||||
else {
|
||||
tftPrint(ALEFT, PIold, 240, advancedRDS ? 72 : 184, RDSDropoutColor, RDSDropoutColorSmooth, 16);
|
||||
tftPrint(ALEFT, stationIDold, 240, advancedRDS ? 89 : 201, RDSDropoutColor, RDSDropoutColorSmooth, 16);
|
||||
tftPrint( 1, stationStateold, 318, advancedRDS ? 89 : 201, RDSDropoutColor, RDSDropoutColorSmooth, 16);
|
||||
tftPrint(1, stationStateold, 318, advancedRDS ? 89 : 201, RDSDropoutColor, RDSDropoutColorSmooth, 16);
|
||||
}
|
||||
|
||||
if (!radio.rds.hasLongPS) {
|
||||
@@ -558,11 +564,11 @@ void ShowAFEON() {
|
||||
if (radio.eon_counter > 9) {
|
||||
if (!afpage) {
|
||||
afpage = true;
|
||||
tftPrint(ARIGHT, String(afpagenr) + "/2", 315, 201, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint16(ARIGHT, String(afpagenr) + "/2", 315, 201, BackgroundColor, BackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
if (afpage) tftPrint(ARIGHT, String(afpagenr) + "/3", 315, 201, ActiveColor, ActiveColorSmooth, 16); else tftPrint(ARIGHT, String(afpagenr) + "/2", 315, 201, ActiveColor, ActiveColorSmooth, 16);
|
||||
if (afpage) tftPrint16(ARIGHT, String(afpagenr) + "/3", 315, 201, ActiveColor, ActiveColorSmooth); else tftPrint16(ARIGHT, String(afpagenr) + "/2", 315, 201, ActiveColor, ActiveColorSmooth);
|
||||
|
||||
if (radio.rds.hasAF && afpagenr == 1) {
|
||||
if (!hasafold) {
|
||||
|
||||
Reference in New Issue
Block a user