From 58e87b615a4e0ee118965402eb6105fc32ed9051 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Mon, 1 Jan 2024 22:06:48 +0100 Subject: [PATCH] Versioning and small fix in language --- src/ARS_Colors.h | 43 +++++++++++++++++++++++++++++++++++ src/constants.h | 2 +- src/gui.cpp | 14 ++++++------ src/language.h | 58 +++++++++++++++++++++++++++++++----------------- 4 files changed, 89 insertions(+), 28 deletions(-) create mode 100644 src/ARS_Colors.h diff --git a/src/ARS_Colors.h b/src/ARS_Colors.h new file mode 100644 index 0000000..f175358 --- /dev/null +++ b/src/ARS_Colors.h @@ -0,0 +1,43 @@ +//MAIN COLORS /* RGB 565 CODES */ +#define Black 0x0000 /* 0, 0, 0 */ +#define Blue 0x001F /* 0, 0, 31 */ +#define Crimson 0xF8C3 /* 31, 6, 3 */ +#define Cyan 0x0F3F /* 1, 57, 31 */ +#define Grey 0x7BEF /* 15, 31, 15 */ +#define Darkgrey 0x39A7 /* 7, 13, 7 */ +#define Green 0x07E0 /* 0, 63, 0 */ +#define Indigo 0x881F /* 17, 0, 31 */ +#define Ocean 0x01FF /* 0, 15, 31 */ +#define Orange 0xFC00 /* 31, 32, 0 */ +#define Red 0xF800 /* 31, 0, 0 */ +#define Sakura 0xF3D5 /* 30, 30, 21 */ +#define Turquoise 0x07FF /* 0, 63, 31 */ +#define Skyblue 0x867D /* 16, 51, 29 */ +#define Tangerine 0xF980 /* 31, 12, 0 */ +#define Teal 0x07F7 /* 0, 63, 23 */ +#define White 0xFFFF /* 31, 63, 31 */ +#define Yellow 0xFFE0 /* 31, 63, 0 */ +//SMOOTH COLORS /* RGB 565 CODES */ +#define CrimsonSmooth 0x3800 /* 7, 0, 0 */ +#define CyanSmooth 0x0105 /* 0, 8, 5 */ +#define GreenSmooth 0x00C0 /* 0, 6, 0 */ +#define IndigoSmooth 0x3080 /* 4, 0, 7 */ +#define OceanSmooth 0x0006 /* 0, 0, 6 */ +#define OrangeSmooth 0x3165 /* 6, 11, 5 */ +#define RedSmooth 0x2000 /* 4, 0, 0 */ +#define SakuraSmooth 0x3008 /* 6, 0, 8 */ +#define SkyblueSmooth 0x10E4 /* 2, 7, 4 */ +#define TangerineSmooth 0x3080 /* 6, 4, 0 */ +#define TealSmooth 0x0144 /* 0, 10, 4 */ +#define WhiteSmooth 0x18E3 /* 3, 7, 3 */ +#define YellowSmooth 0x2120 /* 4, 9, 0 */ +//DARK COLORS /* RGB 565 CODES */ +#define CyanDark 0x5BAF /* 11, 29, 15 */ +#define CrimsonDark 0x6A08 /* 13, 16, 8 */ +#define CyanGrey 0x2A08 /* 5, 16, 8 */ +#define PaleGrey 0x4A69 /* 9, 19, 9 */ +#define PureGrey 0x7BCF /* 15, 30, 15 */ +#define CrimsonDarkSmooth 0x30E3 /* 6, 7, 3 */ +#define CyanDarkSmooth 0x29E8 /* 5, 15, 8 */ +#define CyanFrame 0x01E9 /* 0, 15, 9 */ +#define CrimsonDarkBW 0xFBEF /* 31, 31, 15 */ \ No newline at end of file diff --git a/src/constants.h b/src/constants.h index a348219..467b66e 100644 --- a/src/constants.h +++ b/src/constants.h @@ -107,7 +107,7 @@ // EEPROM index defines #define EE_PRESETS_CNT 99 -#define EE_CHECKBYTE_VALUE 3 // 0 ~ 255,add new entry, change for new value +#define EE_CHECKBYTE_VALUE 2 // 0 ~ 255,add new entry, change for new value #define EE_TOTAL_CNT 823 #define EE_UINT16_FREQUENCY_FM 0 diff --git a/src/gui.cpp b/src/gui.cpp index fd1bbba..8f05201 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -9,7 +9,7 @@ byte menuitem; -byte items[8] = {8, static_cast(dynamicspi ? 5 : 3), 7, 10, 9, 10, 10, 5}; +byte items[8] = {8, static_cast(dynamicspi ? 5 : 4), 7, 10, 9, 10, 10, 5}; void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de/online/rgb565-color-picker/ switch (CurrentTheme) { @@ -492,7 +492,7 @@ void BuildMenu() { if (dynamicspi) { tftPrint(1, "MHz", 310, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][81], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16); - if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][78]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 270, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); + if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][204]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 270, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, String(spispeed * 10, DEC), 270, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); } break; @@ -1027,13 +1027,13 @@ void MenuUp() { break; case ITEM5: - if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][78]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); + if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][204]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(1, String(spispeed * 10, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); spispeed++; if (spispeed > SPI_SPEED_COUNT - 1) spispeed = 0; - if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][78]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); + if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][204]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(1, String(spispeed * 10, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (spispeed == SPI_SPEED_DEFAULT) tft.setSPISpeed(SPI_FREQUENCY / 1000000); else tft.setSPISpeed(spispeed * 10); @@ -1618,13 +1618,13 @@ void MenuDown() { break; case ITEM5: - if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][78]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); + if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][204]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(1, String(spispeed * 10, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); spispeed--; if (spispeed > SPI_SPEED_COUNT - 1) spispeed = SPI_SPEED_COUNT - 1; - if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][78]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); + if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][204]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(1, String(spispeed * 10, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (spispeed == SPI_SPEED_DEFAULT) tft.setSPISpeed(SPI_FREQUENCY / 1000000); else tft.setSPISpeed(spispeed * 10); @@ -2263,7 +2263,7 @@ void DoMenu() { case ITEM5: Infoboxprint(myLanguage[language][81]); tftPrint(-1, "MHz", 170, 118, ActiveColor, ActiveColorSmooth, 28); - if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][78]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(1, String(spispeed * 10 , DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); + if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][204]) + " " + String(SPI_FREQUENCY / 1000000, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(1, String(spispeed * 10 , DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break; } break; diff --git a/src/language.h b/src/language.h index dc9af0b..4442105 100644 --- a/src/language.h +++ b/src/language.h @@ -5,7 +5,7 @@ // [number of languages][number of texts] // *** means the text is the same as in English -static const char* const myLanguage[18][211] = { +static const char* const myLanguage[18][205] = { { "English", // English "Rotary direction changed", // 1 "Please release button", // 2 @@ -209,7 +209,8 @@ static const char* const myLanguage[18][211] = { "Small", // 200 "Large", // 201 "All", // 202 - "Fast PS" // 203 + "Fast PS", // 203 + "Default" // 204 }, { "Nederlands", // Dutch @@ -415,7 +416,8 @@ static const char* const myLanguage[18][211] = { "Laag", // 200 "Middel", // 201 "Alles", // 202 - "Snelle PS" // 203 + "Snelle PS", // 203 + "Standaard" // 204 }, { "Polski", // Polish @@ -621,7 +623,8 @@ static const char* const myLanguage[18][211] = { "Małe", // 200 "Duże", // 201 "Wszystkie", // 202 - "Szybki PS" // 203 + "Szybki PS", // 203 + "Default" // 204 }, { "Hrvatski", // Croatian @@ -827,7 +830,8 @@ static const char* const myLanguage[18][211] = { "Malo", // 200 "Veliko", // 201 "Sve", // 202 - "Brzi PS" // 203 + "Brzi PS", // 203 + "Default" // 204 }, { "Ελληνικά", // Greek @@ -1033,7 +1037,8 @@ static const char* const myLanguage[18][211] = { "Μικρό", // 200 "Μεγάλο", // 201 "Όλα", // 202 - "Γρήγορο PS" // 203 + "Γρήγορο PS", // 203 + "Default" // 204 }, { "Română", // Romanian @@ -1239,7 +1244,8 @@ static const char* const myLanguage[18][211] = { "Mic", // 200 "Mare", // 201 "Toate", // 202 - "PS rapid" // 203 + "PS rapid", // 203 + "Default" // 204 }, { "Deutsch", // German @@ -1445,7 +1451,8 @@ static const char* const myLanguage[18][211] = { "Wenig", // 200 "Viel", // 201 "Maximal", // 202 - "Schnelles PS" // 203 + "Schnelles PS", // 203 + "Default" // 204 }, { "Český", // Czech @@ -1651,7 +1658,8 @@ static const char* const myLanguage[18][211] = { "Malý", // 200 "Velký", // 201 "Vše", // 202 - "Rychlé načtení PS" // 203 + "Rychlé načtení PS", // 203 + "Default" // 204 }, { "Slovenský", // Slovak @@ -1857,7 +1865,8 @@ static const char* const myLanguage[18][211] = { "Malý", // 200 "Veľký", // 201 "Všetko", // 202 - "Rýchle načítanie PS" // 203 + "Rýchle načítanie PS", // 203 + "Default" // 204 }, { "Français", // French @@ -2063,7 +2072,8 @@ static const char* const myLanguage[18][211] = { "Petites", // 200 "Grosses", // 201 "Toutes", // 202 - "PS rapide" // 203 + "PS rapide", // 203 + "Default" // 204 }, { "Български", // Bulgarian @@ -2269,7 +2279,8 @@ static const char* const myLanguage[18][211] = { "Small", // 200 *** "Large", // 201 *** "Всички", // 202 - "Fast PS" // 203 *** + "Fast PS", // 203 *** + "Default" // 204 }, { "Русский", // Russian @@ -2475,7 +2486,8 @@ static const char* const myLanguage[18][211] = { "Мало", // 200 "Больше", // 201 "Все", // 202 - "Быстрый PS" // 203 + "Быстрый PS", // 203 + "Default" // 204 }, { "Українська", // Ukranian @@ -2681,7 +2693,8 @@ static const char* const myLanguage[18][211] = { "Мало", // 200 "Багато", // 201 "Усе", // 202 - "Швидкий PS" // 203 + "Швидкий PS", // 203 + "Default" // 204 }, { "Italiano", // Italian @@ -2887,7 +2900,8 @@ static const char* const myLanguage[18][211] = { "Piccolo", // 200 *** "Grande", // 201 *** "Tutto", // 202 *** - "PS veloce" // 203 *** + "PS veloce", // 203 *** + "Default" // 204 }, { "Simplified Chinese", // Simplified Chinese @@ -3093,7 +3107,8 @@ static const char* const myLanguage[18][211] = { "少量", // 200 "大量", // 201 "全部", // 202 - "快速 PS" // 203 + "快速 PS", // 203 + "Default" // 204 }, { "Norsk", // Norwegian @@ -3299,7 +3314,8 @@ static const char* const myLanguage[18][211] = { "Lite", // 200 "Mye", // 201 "Alt", // 202 - "Rask PS" // 203 + "Rask PS", // 203 + "Default" // 204 }, { "Español", // Spanish @@ -3505,7 +3521,8 @@ static const char* const myLanguage[18][211] = { "Pequeño", // 200 "Grande", // 201 "Todo", // 202 - "PS rápido" // 203 + "PS rápido", // 203 + "Default" // 204 }, { "Português", // Portuguese @@ -3711,7 +3728,8 @@ static const char* const myLanguage[18][211] = { "Pequeno", // 200 "Grande", // 201 "Tudo", // 202 - "PS rápido" // 203 + "PS rápido", // 203 + "Default" // 204 } }; -#endif +#endif \ No newline at end of file