Mods on Chinese display with external .cpp
This commit is contained in:
+24
@@ -9,6 +9,30 @@
|
||||
#include <Wire.h>
|
||||
#include <EEPROM.h>
|
||||
|
||||
static void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int color, int smoothcolor, const uint8_t* font) {
|
||||
if (language == LANGUAGE_CHS) {
|
||||
if (font == FONT16) font = FONT16_CHS;
|
||||
else if (font == FONT28) font = FONT28_CHS;
|
||||
}
|
||||
|
||||
if (currentFont != font || resetFontOnNextCall) {
|
||||
if (currentFont != nullptr) tft.unloadFont();
|
||||
tft.loadFont(font);
|
||||
currentFont = font;
|
||||
resetFontOnNextCall = false;
|
||||
}
|
||||
|
||||
tft.setTextColor(color, smoothcolor, false);
|
||||
|
||||
switch (offset) {
|
||||
case -1: tft.setTextDatum(TL_DATUM); break;
|
||||
case 0: tft.setTextDatum(TC_DATUM); break;
|
||||
case 1: tft.setTextDatum(TR_DATUM); break;
|
||||
}
|
||||
|
||||
tft.drawString(text, x, y, 1);
|
||||
}
|
||||
|
||||
void BuildAFScreen() {
|
||||
if (!afscreen && RDSstatus) {
|
||||
tft.drawRoundRect(20, 30, 274, 170, 5, ActiveColor);
|
||||
|
||||
@@ -120,6 +120,8 @@ extern unsigned int ConverterSet;
|
||||
extern unsigned int HighEdgeSet;
|
||||
extern unsigned int LowEdgeSet;
|
||||
extern unsigned int mappedfreqold[20];
|
||||
extern bool resetFontOnNextCall;
|
||||
extern const uint8_t* currentFont;
|
||||
|
||||
extern TFT_eSPI tft;
|
||||
extern TEF6686 radio;
|
||||
@@ -134,7 +136,7 @@ void MenuDown();
|
||||
void DoMenu();
|
||||
|
||||
// Extern:
|
||||
void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int color, int smoothcolor, const uint8_t* font);
|
||||
//void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int color, int smoothcolor, const uint8_t* font);
|
||||
void ShowFreq(int mode);
|
||||
void ShowBandSelectionFM(bool notglanceview, bool normaldisplay);
|
||||
void ShowBandSelectionAM(bool notglanceview, bool normaldisplay);
|
||||
|
||||
Reference in New Issue
Block a user