Fix for continious scrolling
This commit is contained in:
+1
-1
@@ -130,6 +130,7 @@ byte batteryoptionsold;
|
|||||||
byte BWset;
|
byte BWset;
|
||||||
byte BWsetAM;
|
byte BWsetAM;
|
||||||
byte BWsetFM;
|
byte BWsetFM;
|
||||||
|
byte charwidth = 8;
|
||||||
#ifdef CHINA_PORTABLE
|
#ifdef CHINA_PORTABLE
|
||||||
byte hardwaremodel = PORTABLE_ILI9341;
|
byte hardwaremodel = PORTABLE_ILI9341;
|
||||||
#else
|
#else
|
||||||
@@ -247,7 +248,6 @@ int Squelch;
|
|||||||
int Squelchold;
|
int Squelchold;
|
||||||
int SStatusold;
|
int SStatusold;
|
||||||
int Stereostatus;
|
int Stereostatus;
|
||||||
int TickerSpace = tft.textWidth("AA");
|
|
||||||
int volume;
|
int volume;
|
||||||
int XDRBWset;
|
int XDRBWset;
|
||||||
int XDRBWsetold;
|
int XDRBWsetold;
|
||||||
|
|||||||
+20
-20
@@ -85,10 +85,10 @@ void ShowAdvancedRDS() {
|
|||||||
if (millis() - afticker >= 15) {
|
if (millis() - afticker >= 15) {
|
||||||
if (radio.rds.hasAF) {
|
if (radio.rds.hasAF) {
|
||||||
if (afstring.length() != afstringlengthold) {
|
if (afstring.length() != afstringlengthold) {
|
||||||
afstringWidth = tft.textWidth(afstring) + TickerSpace;
|
afstringWidth = afstring.length() * charwidth;
|
||||||
afstringlengthold = afstring.length();
|
afstringlengthold = afstring.length();
|
||||||
}
|
}
|
||||||
if (xPos2 < -(afstringWidth + TickerSpace)) xPos2 = 0;
|
if (xPos2 < -afstringWidth) xPos2 = 0;
|
||||||
if (xPos2 == 0) {
|
if (xPos2 == 0) {
|
||||||
if (millis() - aftickerhold >= 2000) {
|
if (millis() - aftickerhold >= 2000) {
|
||||||
xPos2 --;
|
xPos2 --;
|
||||||
@@ -105,7 +105,7 @@ void ShowAdvancedRDS() {
|
|||||||
RDSSprite.fillSprite(BackgroundColor);
|
RDSSprite.fillSprite(BackgroundColor);
|
||||||
if (RDSstatus) RDSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RDSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
if (RDSstatus) RDSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RDSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||||
RDSSprite.drawString(afstring, xPos2, 2);
|
RDSSprite.drawString(afstring, xPos2, 2);
|
||||||
if (radio.rds.hasAF) RDSSprite.drawString(afstring, xPos2 + afstringWidth + TickerSpace, 2);
|
if (radio.rds.hasAF) RDSSprite.drawString(afstring, xPos2 + afstringWidth, 2);
|
||||||
RDSSprite.pushSprite(35, 197);
|
RDSSprite.pushSprite(35, 197);
|
||||||
afticker = millis();
|
afticker = millis();
|
||||||
}
|
}
|
||||||
@@ -123,10 +123,10 @@ void ShowAdvancedRDS() {
|
|||||||
|
|
||||||
if (radio.rds.hasEON) {
|
if (radio.rds.hasEON) {
|
||||||
if (eonstring.length() != eonstringlengthold) {
|
if (eonstring.length() != eonstringlengthold) {
|
||||||
eonstringWidth = tft.textWidth(eonstring) + TickerSpace;
|
eonstringWidth = eonstring.length() * charwidth;
|
||||||
eonstringlengthold = eonstring.length();
|
eonstringlengthold = eonstring.length();
|
||||||
}
|
}
|
||||||
if (xPos3 < -(eonstringWidth + TickerSpace)) xPos3 = 0;
|
if (xPos3 < -eonstringWidth) xPos3 = 0;
|
||||||
if (xPos3 == 0) {
|
if (xPos3 == 0) {
|
||||||
if (millis() - eontickerhold >= 2000) {
|
if (millis() - eontickerhold >= 2000) {
|
||||||
xPos3 --;
|
xPos3 --;
|
||||||
@@ -142,7 +142,7 @@ void ShowAdvancedRDS() {
|
|||||||
RDSSprite.fillSprite(BackgroundColor);
|
RDSSprite.fillSprite(BackgroundColor);
|
||||||
if (RDSstatus) RDSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RDSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
if (RDSstatus) RDSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RDSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||||
RDSSprite.drawString(eonstring, xPos3, 2);
|
RDSSprite.drawString(eonstring, xPos3, 2);
|
||||||
if (radio.rds.hasEON) RDSSprite.drawString(eonstring, xPos3 + eonstringWidth + TickerSpace, 2);
|
if (radio.rds.hasEON) RDSSprite.drawString(eonstring, xPos3 + eonstringWidth, 2);
|
||||||
RDSSprite.pushSprite(35, 172);
|
RDSSprite.pushSprite(35, 172);
|
||||||
eonticker = millis();
|
eonticker = millis();
|
||||||
}
|
}
|
||||||
@@ -160,10 +160,10 @@ void ShowAdvancedRDS() {
|
|||||||
if (millis() - rtplusticker >= 15) {
|
if (millis() - rtplusticker >= 15) {
|
||||||
if (radio.rds.hasRDSplus) {
|
if (radio.rds.hasRDSplus) {
|
||||||
if (rtplusstring.length() != rtplusstringlengthold) {
|
if (rtplusstring.length() != rtplusstringlengthold) {
|
||||||
rtplusstringWidth = tft.textWidth(rtplusstring) + TickerSpace;
|
rtplusstringWidth = rtplusstring.length() * charwidth;
|
||||||
rtplusstringlengthold = rtplusstring.length();
|
rtplusstringlengthold = rtplusstring.length();
|
||||||
}
|
}
|
||||||
if (xPos4 < -(rtplusstringWidth + TickerSpace)) xPos4 = 0;
|
if (xPos4 < -rtplusstringWidth) xPos4 = 0;
|
||||||
if (xPos4 == 0) {
|
if (xPos4 == 0) {
|
||||||
if (millis() - rtplustickerhold >= 2000) {
|
if (millis() - rtplustickerhold >= 2000) {
|
||||||
xPos4 --;
|
xPos4 --;
|
||||||
@@ -179,7 +179,7 @@ void ShowAdvancedRDS() {
|
|||||||
RDSSprite.fillSprite(BackgroundColor);
|
RDSSprite.fillSprite(BackgroundColor);
|
||||||
if (RDSstatus) RDSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RDSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
if (RDSstatus) RDSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RDSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||||
RDSSprite.drawString(rtplusstring, xPos4, 2);
|
RDSSprite.drawString(rtplusstring, xPos4, 2);
|
||||||
if (radio.rds.hasRDSplus) RDSSprite.drawString(rtplusstring, xPos4 + rtplusstringWidth + TickerSpace, 2);
|
if (radio.rds.hasRDSplus) RDSSprite.drawString(rtplusstring, xPos4 + rtplusstringWidth, 2);
|
||||||
RDSSprite.pushSprite(35, 146);
|
RDSSprite.pushSprite(35, 146);
|
||||||
rtplusticker = millis();
|
rtplusticker = millis();
|
||||||
}
|
}
|
||||||
@@ -319,14 +319,14 @@ void readRds() {
|
|||||||
AdvRadiotextSprite.fillSprite(BackgroundColor);
|
AdvRadiotextSprite.fillSprite(BackgroundColor);
|
||||||
AdvRadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
AdvRadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||||
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
||||||
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth + TickerSpace, 2);
|
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);
|
||||||
AdvRadiotextSprite.pushSprite(35, 220);
|
AdvRadiotextSprite.pushSprite(35, 220);
|
||||||
} else if (!advancedRDS && radio.rds.stationText.length() < 29) {
|
} else if (!advancedRDS && radio.rds.stationText.length() < 29) {
|
||||||
xPos = 0;
|
xPos = 0;
|
||||||
RadiotextSprite.fillSprite(BackgroundColor);
|
RadiotextSprite.fillSprite(BackgroundColor);
|
||||||
RadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
RadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||||
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
||||||
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth + TickerSpace, 2);
|
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);
|
||||||
RadiotextSprite.pushSprite(38, 220);
|
RadiotextSprite.pushSprite(38, 220);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,14 +365,14 @@ void readRds() {
|
|||||||
AdvRadiotextSprite.fillSprite(BackgroundColor);
|
AdvRadiotextSprite.fillSprite(BackgroundColor);
|
||||||
AdvRadiotextSprite.setTextColor(RDSColor, RDSColorSmooth, false);
|
AdvRadiotextSprite.setTextColor(RDSColor, RDSColorSmooth, false);
|
||||||
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
||||||
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth + TickerSpace, 2);
|
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);
|
||||||
AdvRadiotextSprite.pushSprite(35, 220);
|
AdvRadiotextSprite.pushSprite(35, 220);
|
||||||
} else if (!advancedRDS && radio.rds.stationText.length() < 29) {
|
} else if (!advancedRDS && radio.rds.stationText.length() < 29) {
|
||||||
xPos = 0;
|
xPos = 0;
|
||||||
RadiotextSprite.fillSprite(BackgroundColor);
|
RadiotextSprite.fillSprite(BackgroundColor);
|
||||||
RadiotextSprite.setTextColor(RDSColor, RDSColorSmooth, false);
|
RadiotextSprite.setTextColor(RDSColor, RDSColorSmooth, false);
|
||||||
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
||||||
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth + TickerSpace, 2);
|
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);
|
||||||
RadiotextSprite.pushSprite(38, 220);
|
RadiotextSprite.pushSprite(38, 220);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -608,7 +608,7 @@ void showRadioText() {
|
|||||||
if (!screenmute) {
|
if (!screenmute) {
|
||||||
if (radio.rds.hasRT && radio.rds.stationText.length() > 0) {
|
if (radio.rds.hasRT && radio.rds.stationText.length() > 0) {
|
||||||
if (String(radio.rds.stationText + radio.rds.stationText32).length() != Radiotextlengthold) {
|
if (String(radio.rds.stationText + radio.rds.stationText32).length() != Radiotextlengthold) {
|
||||||
RadiotextWidth = tft.textWidth(radio.rds.stationText + " " + radio.rds.stationText32) + TickerSpace;
|
RadiotextWidth = String(radio.rds.stationText + " " + radio.rds.stationText32).length() * charwidth;
|
||||||
Radiotextlengthold = String(radio.rds.stationText + radio.rds.stationText32).length();
|
Radiotextlengthold = String(radio.rds.stationText + radio.rds.stationText32).length();
|
||||||
}
|
}
|
||||||
if (advancedRDS && radio.rds.stationText.length() < 20) {
|
if (advancedRDS && radio.rds.stationText.length() < 20) {
|
||||||
@@ -635,18 +635,18 @@ void showRadioText() {
|
|||||||
rttickerhold = millis();
|
rttickerhold = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xPos < -(RadiotextWidth + TickerSpace)) xPos = 0;
|
if (xPos < -RadiotextWidth) xPos = 0;
|
||||||
if (advancedRDS) {
|
if (advancedRDS) {
|
||||||
AdvRadiotextSprite.fillSprite(BackgroundColor);
|
AdvRadiotextSprite.fillSprite(BackgroundColor);
|
||||||
if (RDSstatus) AdvRadiotextSprite.setTextColor(RDSColor, RDSColorSmooth, false); else AdvRadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
if (RDSstatus) AdvRadiotextSprite.setTextColor(RDSColor, RDSColorSmooth, false); else AdvRadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||||
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
||||||
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth + TickerSpace, 2);
|
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);
|
||||||
AdvRadiotextSprite.pushSprite(35, 220);
|
AdvRadiotextSprite.pushSprite(35, 220);
|
||||||
} else {
|
} else {
|
||||||
RadiotextSprite.fillSprite(BackgroundColor);
|
RadiotextSprite.fillSprite(BackgroundColor);
|
||||||
if (RDSstatus) RadiotextSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
if (RDSstatus) RadiotextSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RadiotextSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||||
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
|
||||||
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth + TickerSpace, 2);
|
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos + RadiotextWidth, 2);
|
||||||
RadiotextSprite.pushSprite(38, 220);
|
RadiotextSprite.pushSprite(38, 220);
|
||||||
}
|
}
|
||||||
rtticker = millis();
|
rtticker = millis();
|
||||||
@@ -849,11 +849,11 @@ void ShowAFEON() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (AIDString.length() != AIDlengthold) {
|
if (AIDString.length() != AIDlengthold) {
|
||||||
AIDWidth = tft.textWidth(String(myLanguage[language][93]) + " - " + String(myLanguage[language][79]) + ": " + AIDString) + TickerSpace;
|
AIDWidth = String(String(myLanguage[language][93]) + " - " + String(myLanguage[language][79]) + ": " + AIDString).length() * charwidth;
|
||||||
AIDlengthold = AIDString.length();
|
AIDlengthold = AIDString.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xPos < -(AIDWidth + TickerSpace)) xPos = 0;
|
if (xPos < -AIDWidth) xPos = 0;
|
||||||
if (xPos == 0) {
|
if (xPos == 0) {
|
||||||
if (millis() - rttickerhold >= 1000) {
|
if (millis() - rttickerhold >= 1000) {
|
||||||
xPos --;
|
xPos --;
|
||||||
@@ -866,7 +866,7 @@ void ShowAFEON() {
|
|||||||
RadiotextSprite.fillSprite(BackgroundColor);
|
RadiotextSprite.fillSprite(BackgroundColor);
|
||||||
RadiotextSprite.setTextColor(ActiveColor, ActiveColorSmooth, false);
|
RadiotextSprite.setTextColor(ActiveColor, ActiveColorSmooth, false);
|
||||||
RadiotextSprite.drawString(String(myLanguage[language][93]) + " - " + String(myLanguage[language][79]) + ": " + AIDString, xPos, 2);
|
RadiotextSprite.drawString(String(myLanguage[language][93]) + " - " + String(myLanguage[language][79]) + ": " + AIDString, xPos, 2);
|
||||||
RadiotextSprite.drawString(String(myLanguage[language][93]) + " - " + String(myLanguage[language][79]) + ": " + AIDString, xPos + AIDWidth + TickerSpace, 2);
|
RadiotextSprite.drawString(String(myLanguage[language][93]) + " - " + String(myLanguage[language][79]) + ": " + AIDString, xPos + AIDWidth, 2);
|
||||||
RadiotextSprite.pushSprite(5, 220);
|
RadiotextSprite.pushSprite(5, 220);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ extern byte af_counterold;
|
|||||||
extern byte aid_counterold;
|
extern byte aid_counterold;
|
||||||
extern byte afpagenr;
|
extern byte afpagenr;
|
||||||
extern byte band;
|
extern byte band;
|
||||||
|
extern byte charwidth;
|
||||||
extern byte ECCold;
|
extern byte ECCold;
|
||||||
extern byte language;
|
extern byte language;
|
||||||
extern byte licold;
|
extern byte licold;
|
||||||
@@ -70,7 +71,6 @@ extern int SecondaryColor;
|
|||||||
extern int SecondaryColorSmooth;
|
extern int SecondaryColorSmooth;
|
||||||
extern int SignificantColor;
|
extern int SignificantColor;
|
||||||
extern int SignificantColorSmooth;
|
extern int SignificantColorSmooth;
|
||||||
extern int TickerSpace;
|
|
||||||
extern int xPos;
|
extern int xPos;
|
||||||
extern int xPos2;
|
extern int xPos2;
|
||||||
extern int xPos3;
|
extern int xPos3;
|
||||||
|
|||||||
Reference in New Issue
Block a user