Add FM deemphasis

This commit is contained in:
ohmytime
2023-08-17 08:03:55 +08:00
parent 6ae1a0266a
commit 2ce25a2888
8 changed files with 7625 additions and 7440 deletions
+16 -12
View File
@@ -131,6 +131,7 @@ byte ECCold;
byte EQset; byte EQset;
byte fmdefaultstepsize; byte fmdefaultstepsize;
byte fmnb; byte fmnb;
byte fmdeemphasis;
byte amcodect; byte amcodect;
byte amcodectcount; byte amcodectcount;
byte amrfagc; byte amrfagc;
@@ -412,6 +413,7 @@ void setup() {
amrfagc = EEPROM.readByte(EE_BYTE_AM_RF_AGC); amrfagc = EEPROM.readByte(EE_BYTE_AM_RF_AGC);
radio.rds.sortaf = EEPROM.readByte(EE_BYTE_SORTAF); radio.rds.sortaf = EEPROM.readByte(EE_BYTE_SORTAF);
stationlistid = EEPROM.readByte(EE_BYTE_STATIONLISTID); stationlistid = EEPROM.readByte(EE_BYTE_STATIONLISTID);
fmdeemphasis = EEPROM.readByte(EE_BYTE_FM_DEEMPHASIS);
LWLowEdgeSet = FREQ_LW_LOW_EDGE_MIN; // later will read from flash LWLowEdgeSet = FREQ_LW_LOW_EDGE_MIN; // later will read from flash
LWHighEdgeSet = FREQ_LW_HIGH_EDGE_MAX; // later will read from flash LWHighEdgeSet = FREQ_LW_HIGH_EDGE_MAX; // later will read from flash
@@ -648,7 +650,7 @@ void setup() {
radio.setAMNoiseBlanker(amnb); radio.setAMNoiseBlanker(amnb);
radio.setFMNoiseBlanker(fmnb); radio.setFMNoiseBlanker(fmnb);
radio.setAudio(audiomode); radio.setAudio(audiomode);
if (region == 1) radio.setDeemphasis(2); radio.setDeemphasis(fmdeemphasis);
radio.rds.region = region; radio.rds.region = region;
LowLevelInit = true; LowLevelInit = true;
@@ -733,8 +735,8 @@ void loop() {
} }
} }
} }
if (region == 0) tftPrint(-1, "PI:", 212, 193, ActiveColor, ActiveColorSmooth, 16); if (region == REGION_EU) tftPrint(-1, "PI:", 212, 193, ActiveColor, ActiveColorSmooth, 16);
if (region == 1) tftPrint(-1, "ID:", 212, 193, ActiveColor, ActiveColorSmooth, 16); if (region == REGION_US) tftPrint(-1, "ID:", 212, 193, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "PS:", 3, 193, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "PS:", 3, 193, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "RT:", 3, 221, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "RT:", 3, 221, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "PTY:", 3, 163, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "PTY:", 3, 163, ActiveColor, ActiveColorSmooth, 16);
@@ -762,8 +764,8 @@ void loop() {
tftPrint(0, "M", 7, 128, GreyoutColor, BackgroundColor, 16); tftPrint(0, "M", 7, 128, GreyoutColor, BackgroundColor, 16);
tft.fillRect(16, 133, 188, 6, GreyoutColor); tft.fillRect(16, 133, 188, 6, GreyoutColor);
} }
if (region == 0) tftPrint(-1, "PI:", 212, 193, GreyoutColor, BackgroundColor, 16); if (region == REGION_EU) tftPrint(-1, "PI:", 212, 193, GreyoutColor, BackgroundColor, 16);
if (region == 1) tftPrint(-1, "ID:", 212, 193, GreyoutColor, BackgroundColor, 16); if (region == REGION_US) tftPrint(-1, "ID:", 212, 193, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "PS:", 3, 193, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "PS:", 3, 193, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "RT:", 3, 221, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "RT:", 3, 221, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "PTY:", 3, 163, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "PTY:", 3, 163, GreyoutColor, BackgroundColor, 16);
@@ -1612,8 +1614,8 @@ void SelectBand() {
doBW(); doBW();
if (!screenmute) { if (!screenmute) {
BuildDisplay(); BuildDisplay();
if (region == 0) tftPrint(-1, "PI:", 212, 193, GreyoutColor, BackgroundColor, 16); if (region == REGION_EU) tftPrint(-1, "PI:", 212, 193, GreyoutColor, BackgroundColor, 16);
if (region == 1) tftPrint(-1, "ID:", 212, 193, GreyoutColor, BackgroundColor, 16); if (region == REGION_US) tftPrint(-1, "ID:", 212, 193, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "PS:", 3, 193, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "PS:", 3, 193, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "RT:", 3, 221, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "RT:", 3, 221, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "PTY:", 3, 163, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "PTY:", 3, 163, GreyoutColor, BackgroundColor, 16);
@@ -1799,6 +1801,7 @@ void ModeButtonPress() {
EEPROM.writeByte(EE_BYTE_AM_RF_AGC, amrfagc); EEPROM.writeByte(EE_BYTE_AM_RF_AGC, amrfagc);
EEPROM.writeByte(EE_BYTE_SORTAF, radio.rds.sortaf); EEPROM.writeByte(EE_BYTE_SORTAF, radio.rds.sortaf);
EEPROM.writeByte(EE_BYTE_STATIONLISTID, stationlistid); EEPROM.writeByte(EE_BYTE_STATIONLISTID, stationlistid);
EEPROM.writeByte(EE_BYTE_FM_DEEMPHASIS, fmdeemphasis);
EEPROM.commit(); EEPROM.commit();
Serial.end(); Serial.end();
if (wifi) remoteip = IPAddress (WiFi.localIP()[0], WiFi.localIP()[1], WiFi.localIP()[2], subnetclient); if (wifi) remoteip = IPAddress (WiFi.localIP()[0], WiFi.localIP()[1], WiFi.localIP()[2], subnetclient);
@@ -1887,8 +1890,8 @@ void RoundStep() {
radio.SetFreq(frequency_OIRT); radio.SetFreq(frequency_OIRT);
} else { } else {
if (band == BAND_MW) { if (band == BAND_MW) {
unsigned int freq = frequency_AM / (region == 0 ? FREQ_MW_STEP_9K : FREQ_MW_STEP_10K); unsigned int freq = frequency_AM / (region == REGION_EU ? FREQ_MW_STEP_9K : FREQ_MW_STEP_10K);
frequency_AM = freq * (region == 0 ? FREQ_MW_STEP_9K : FREQ_MW_STEP_10K); frequency_AM = freq * (region == REGION_EU ? FREQ_MW_STEP_9K : FREQ_MW_STEP_10K);
radio.SetFreqAM(frequency_AM); radio.SetFreqAM(frequency_AM);
} else if (band == BAND_SW) { } else if (band == BAND_SW) {
Round5K(frequency_AM); Round5K(frequency_AM);
@@ -2854,10 +2857,10 @@ void TuneUp() {
if (stepsize == 0) { if (stepsize == 0) {
if (band > BAND_GAP) { if (band > BAND_GAP) {
if (frequency_AM < MWHighEdgeSet) { if (frequency_AM < MWHighEdgeSet) {
if (region == 0) { if (region == REGION_EU) {
temp = FREQ_MW_STEP_9K; temp = FREQ_MW_STEP_9K;
frequency_AM = (frequency_AM / FREQ_MW_STEP_9K) * FREQ_MW_STEP_9K; frequency_AM = (frequency_AM / FREQ_MW_STEP_9K) * FREQ_MW_STEP_9K;
} else if (region == 1) { } else if (region == REGION_US) {
temp = FREQ_MW_STEP_10K; temp = FREQ_MW_STEP_10K;
frequency_AM = (frequency_AM / FREQ_MW_STEP_10K) * FREQ_MW_STEP_10K; frequency_AM = (frequency_AM / FREQ_MW_STEP_10K) * FREQ_MW_STEP_10K;
} }
@@ -2933,7 +2936,7 @@ void TuneDown() {
frequency_AM = 1998; frequency_AM = 1998;
temp = 0; temp = 0;
} else { } else {
temp = region == 0 ? FREQ_MW_STEP_9K : FREQ_MW_STEP_10K; temp = region == REGION_EU ? FREQ_MW_STEP_9K : FREQ_MW_STEP_10K;
frequency_AM = (frequency_AM / temp) * temp; frequency_AM = (frequency_AM / temp) * temp;
} }
} else { } else {
@@ -3169,6 +3172,7 @@ void DefaultSettings(byte userhardwaremodel) {
EEPROM.writeByte(EE_BYTE_AM_RF_AGC, 0); EEPROM.writeByte(EE_BYTE_AM_RF_AGC, 0);
EEPROM.writeByte(EE_BYTE_SORTAF, 1); EEPROM.writeByte(EE_BYTE_SORTAF, 1);
EEPROM.writeByte(EE_BYTE_STATIONLISTID, 1); EEPROM.writeByte(EE_BYTE_STATIONLISTID, 1);
EEPROM.writeByte(EE_BYTE_FM_DEEMPHASIS, DEEMPHASIS_50);
EEPROM.commit(); EEPROM.commit();
} }
+4199 -4167
View File
File diff suppressed because it is too large Load Diff
+3304 -3218
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -48,6 +48,11 @@ enum RADIO_BATTERY_SELECTION {
RADIO_BATTERY_CNT RADIO_BATTERY_CNT
}; };
enum RADIO_FM_DEEMPHASIS {
DEEMPHASIS_NONE = 0, DEEMPHASIS_50, DEEMPHASIS_70,
DEEMPHASIS_COUNT
};
static const char* const PTY_EU[] { static const char* const PTY_EU[] {
"None", "None",
"News", "News",
+8 -2
View File
@@ -48,6 +48,11 @@
#define FREQ_FM_OIRT_START 6500 // use values of 1/10 * kHz #define FREQ_FM_OIRT_START 6500 // use values of 1/10 * kHz
#define FREQ_FM_OIRT_END 7400 // use values of 1/10 * kHz #define FREQ_FM_OIRT_END 7400 // use values of 1/10 * kHz
#define FM_DEEMPHASIS_50 50
#define FM_DEEMPHASIS_70 70
#define REGION_EU 0
#define REGION_US 1
// according to https://www.short-wave.info/index.php?feature=frequencies // according to https://www.short-wave.info/index.php?feature=frequencies
#define FREQ_SW_START 1800 #define FREQ_SW_START 1800
#define FREQ_SW_END 27000 #define FREQ_SW_END 27000
@@ -101,9 +106,9 @@
// EEPROM index defines // EEPROM index defines
#define EE_PRESETS_CNT 30 #define EE_PRESETS_CNT 30
#define EE_CHECKBYTE_VALUE 18 // 0 ~ 255,add new entry, change for new value #define EE_CHECKBYTE_VALUE 32 // 0 ~ 255,add new entry, change for new value
#define EE_TOTAL_CNT 277 #define EE_TOTAL_CNT 278
#define EE_UINT16_FREQUENCY_FM 0 #define EE_UINT16_FREQUENCY_FM 0
#define EE_BYTE_VOLSET 4 #define EE_BYTE_VOLSET 4
#define EE_BYTE_STEREO 5 #define EE_BYTE_STEREO 5
@@ -175,6 +180,7 @@
#define EE_BYTE_AM_CO_DECT 274 #define EE_BYTE_AM_CO_DECT 274
#define EE_BYTE_AM_CO_DECT_COUNT 275 #define EE_BYTE_AM_CO_DECT_COUNT 275
#define EE_BYTE_AM_RF_AGC 276 #define EE_BYTE_AM_RF_AGC 276
#define EE_BYTE_FM_DEEMPHASIS 277
// End of EEPROM index defines // End of EEPROM index defines
static const char* const unitString[] = {"dBμV", "dBf", "dBm"}; static const char* const unitString[] = {"dBμV", "dBf", "dBm"};
+59 -24
View File
@@ -6,7 +6,7 @@
#include <EEPROM.h> #include <EEPROM.h>
byte menuitem; byte menuitem;
byte items[8] = {8, 2, 6, 9, 8, 9, 8, 5}; byte items[8] = {8, 2, 6, 9, 8, 10, 8, 5};
void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de/online/rgb565-color-picker/ void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de/online/rgb565-color-picker/
switch (CurrentTheme) { switch (CurrentTheme) {
@@ -459,8 +459,8 @@ void BuildMenu() {
tftPrint(-1, myLanguage[language][196], 8, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][196], 8, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16);
if (showrdserrors) tftPrint(1, myLanguage[language][42], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (showrdserrors) tftPrint(1, myLanguage[language][42], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (region == 0) tftPrint(1, myLanguage[language][47], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (region == REGION_EU) tftPrint(1, myLanguage[language][47], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (region == 1) tftPrint(1, myLanguage[language][48], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (region == REGION_US) tftPrint(1, myLanguage[language][48], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (radio.rds.underscore) tftPrint(1, myLanguage[language][42], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (radio.rds.underscore) tftPrint(1, myLanguage[language][42], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (radio.rds.filter) tftPrint(1, myLanguage[language][42], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (radio.rds.filter) tftPrint(1, myLanguage[language][42], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (radio.rds.pierrors) tftPrint(1, myLanguage[language][42], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (radio.rds.pierrors) tftPrint(1, myLanguage[language][42], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16);
@@ -479,6 +479,7 @@ void BuildMenu() {
tftPrint(-1, myLanguage[language][65], 8, ITEM7 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][65], 8, ITEM7 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][90], 8, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][90], 8, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][100], 8, ITEM9 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][100], 8, ITEM9 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][199], 8, ITEM10 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, "MHz", 310, ITEM1 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(1, "MHz", 310, ITEM1 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, String(ConverterSet, DEC), 270, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); tftPrint(1, String(ConverterSet, DEC), 270, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16);
@@ -501,6 +502,8 @@ void BuildMenu() {
case FM_BAND_OIRT: tftPrint(1, myLanguage[language][106], 310, ITEM9 + 6, PrimaryColor, PrimaryColorSmooth, 16); break; case FM_BAND_OIRT: tftPrint(1, myLanguage[language][106], 310, ITEM9 + 6, PrimaryColor, PrimaryColorSmooth, 16); break;
case FM_BAND_FM: tftPrint(1, myLanguage[language][105], 310, ITEM9 + 6, PrimaryColor, PrimaryColorSmooth, 16); break; case FM_BAND_FM: tftPrint(1, myLanguage[language][105], 310, ITEM9 + 6, PrimaryColor, PrimaryColorSmooth, 16); break;
} }
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(1, String((fmdeemphasis == DEEMPHASIS_50 ? FM_DEEMPHASIS_50 : FM_DEEMPHASIS_70), DEC), 270, ITEM10 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM10 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(1, "μs", 310, ITEM10 + 6, ActiveColor, ActiveColorSmooth, 16);
break; break;
case AMSETTINGS: case AMSETTINGS:
@@ -519,7 +522,7 @@ void BuildMenu() {
if (amnb != 0) tftPrint(1, String(amnb, DEC), 270, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (amnb != 0) tftPrint(1, String(amnb, DEC), 270, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "dB", 310, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(1, "dB", 310, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 16);
if (AMLevelOffset > 0) tftPrint(1, "+" + String(AMLevelOffset, DEC), 270, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, String(AMLevelOffset, DEC), 270, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (AMLevelOffset > 0) tftPrint(1, "+" + String(AMLevelOffset, DEC), 270, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, String(AMLevelOffset, DEC), 270, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (amrfagc != 0) tftPrint(1, "dB", 310, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16); if (amrfagc != 0) tftPrint(1, "dB", 310, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM8 + 6, PrimaryColor, PrimaryColorSmooth, 16);
switch (bandAM) { switch (bandAM) {
case AM_BAND_ALL: tftPrint(1, myLanguage[language][102] + String(",") + myLanguage[language][103] + String(",") + myLanguage[language][104], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); break; case AM_BAND_ALL: tftPrint(1, myLanguage[language][102] + String(",") + myLanguage[language][103] + String(",") + myLanguage[language][104], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); break;
@@ -586,8 +589,8 @@ void BuildAdvancedRDS() {
tftPrint(-1, "ERRORS", 3, 34, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "ERRORS", 3, 34, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, unitString[unit], 310, 51, ActiveColor, ActiveColorSmooth, 16); tftPrint(1, unitString[unit], 310, 51, ActiveColor, ActiveColorSmooth, 16);
if (region == 0) tftPrint(-1, "PI", ITEM10 + 6, 81, ActiveColor, ActiveColorSmooth, 16); if (region == REGION_EU) tftPrint(-1, "PI", ITEM10 + 6, 81, ActiveColor, ActiveColorSmooth, 16);
if (region == 1) tftPrint(-1, "ID", ITEM10 + 6, 81, ActiveColor, ActiveColorSmooth, 16); if (region == REGION_US) tftPrint(-1, "ID", ITEM10 + 6, 81, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "PS", 3, 81, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "PS", 3, 81, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "PTY", 3, 109, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "PTY", 3, 109, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "RT+", 3, 147, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "RT+", 3, 147, ActiveColor, ActiveColorSmooth, 16);
@@ -717,8 +720,8 @@ void BuildDisplay() {
if (showsquelch) tftPrint(-1, "SQ:", 212, 145, ActiveColor, ActiveColorSmooth, 16); if (showsquelch) tftPrint(-1, "SQ:", 212, 145, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, "C/N", 270, 163, ActiveColor, ActiveColorSmooth, 16); tftPrint(1, "C/N", 270, 163, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "dB", 300, 163, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "dB", 300, 163, ActiveColor, ActiveColorSmooth, 16);
if (region == 0) tftPrint(-1, "PI:", 212, 193, ActiveColor, ActiveColorSmooth, 16); if (region == REGION_EU) tftPrint(-1, "PI:", 212, 193, ActiveColor, ActiveColorSmooth, 16);
if (region == 1) tftPrint(-1, "ID:", 212, 193, ActiveColor, ActiveColorSmooth, 16); if (region == REGION_US) tftPrint(-1, "ID:", 212, 193, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "PS:", 3, 193, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "PS:", 3, 193, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "RT:", 3, 221, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "RT:", 3, 221, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "PTY:", 3, 163, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "PTY:", 3, 163, ActiveColor, ActiveColorSmooth, 16);
@@ -1019,14 +1022,14 @@ void MenuUp() {
break; break;
case ITEM2: case ITEM2:
if (region == 0) tftPrint(0, myLanguage[language][47], 155, 118, BackgroundColor, BackgroundColor, 28); if (region == REGION_EU) tftPrint(0, myLanguage[language][47], 155, 118, BackgroundColor, BackgroundColor, 28);
if (region == 1) tftPrint(0, myLanguage[language][48], 155, 118, BackgroundColor, BackgroundColor, 28); if (region == REGION_US) tftPrint(0, myLanguage[language][48], 155, 118, BackgroundColor, BackgroundColor, 28);
if (region == 0) region = 1; else region = 0; if (region == REGION_EU) region = REGION_US; else region = REGION_EU;
if (region == 0) tftPrint(0, myLanguage[language][47], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_EU) tftPrint(0, myLanguage[language][47], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (region == 1) tftPrint(0, myLanguage[language][48], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_US) tftPrint(0, myLanguage[language][48], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
regionold = region; regionold = region;
if (region == 0) radio.setDeemphasis(1); if (region == REGION_EU) { fmdeemphasis = DEEMPHASIS_50; radio.setDeemphasis(fmdeemphasis); }
if (region == 1) radio.setDeemphasis(2); if (region == REGION_US) { fmdeemphasis = DEEMPHASIS_70; radio.setDeemphasis(fmdeemphasis); }
radio.rds.region = region; radio.rds.region = region;
break; break;
@@ -1156,6 +1159,19 @@ void MenuUp() {
case FM_BAND_FM: tftPrint(0, myLanguage[language][105], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break; case FM_BAND_FM: tftPrint(0, myLanguage[language][105], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
} }
break; break;
case ITEM10:
tftPrint(0, myLanguage[language][199], 155, 78, ActiveColor, ActiveColorSmooth, 28);
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(1, String((fmdeemphasis == DEEMPHASIS_50 ? FM_DEEMPHASIS_50 : FM_DEEMPHASIS_70), DEC), 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(1, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (fmnb != 0) tftPrint(-1, "μs", 170, 118, ActiveColor, ActiveColor, 28);
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(-1, "μs", 170, 118, BackgroundColor, BackgroundColor, 28);
fmdeemphasis++;
if (fmdeemphasis > DEEMPHASIS_COUNT - 1) fmdeemphasis = DEEMPHASIS_NONE;
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(1, String((fmdeemphasis == DEEMPHASIS_50 ? FM_DEEMPHASIS_50 : FM_DEEMPHASIS_70), DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(1, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(-1, "μs", 170, 118, ActiveColor, PrimaryColorSmooth, 28);
radio.setDeemphasis(fmdeemphasis);
break;
} }
break; break;
@@ -1500,14 +1516,14 @@ void MenuDown() {
break; break;
case ITEM2: case ITEM2:
if (region == 0) tftPrint(0, myLanguage[language][47], 155, 118, BackgroundColor, BackgroundColor, 28); if (region == REGION_EU) tftPrint(0, myLanguage[language][47], 155, 118, BackgroundColor, BackgroundColor, 28);
if (region == 1) tftPrint(0, myLanguage[language][48], 155, 118, BackgroundColor, BackgroundColor, 28); if (region == REGION_US) tftPrint(0, myLanguage[language][48], 155, 118, BackgroundColor, BackgroundColor, 28);
if (region == 0) region = 1; else region = 0; if (region == REGION_EU) region = REGION_US; else region = REGION_EU;
if (region == 0) tftPrint(0, myLanguage[language][47], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_EU) tftPrint(0, myLanguage[language][47], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (region == 1) tftPrint(0, myLanguage[language][48], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_US) tftPrint(0, myLanguage[language][48], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
regionold = region; regionold = region;
if (region == 0) radio.setDeemphasis(1); if (region == REGION_EU) { fmdeemphasis = DEEMPHASIS_50; radio.setDeemphasis(fmdeemphasis); }
if (region == 1) radio.setDeemphasis(2); if (region == REGION_US) { fmdeemphasis = DEEMPHASIS_70; radio.setDeemphasis(fmdeemphasis); }
radio.rds.region = region; radio.rds.region = region;
break; break;
@@ -1636,6 +1652,18 @@ void MenuDown() {
case FM_BAND_FM: tftPrint(0, myLanguage[language][105], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break; case FM_BAND_FM: tftPrint(0, myLanguage[language][105], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
} }
break; break;
case ITEM10:
tftPrint(0, myLanguage[language][199], 155, 78, ActiveColor, ActiveColorSmooth, 28);
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(1, String((fmdeemphasis == DEEMPHASIS_50 ? FM_DEEMPHASIS_50 : FM_DEEMPHASIS_70), DEC), 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(1, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(-1, "μs", 170, 118, BackgroundColor, BackgroundColor, 28);
fmdeemphasis--;
if (fmdeemphasis > DEEMPHASIS_COUNT - 1) fmdeemphasis = DEEMPHASIS_COUNT - 1;
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(1, String((fmdeemphasis == DEEMPHASIS_50 ? FM_DEEMPHASIS_50 : FM_DEEMPHASIS_70), DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(1, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(-1, "μs", 170, 118, ActiveColor, PrimaryColorSmooth, 28);
radio.setDeemphasis(fmdeemphasis);
break;
} }
break; break;
@@ -1979,8 +2007,8 @@ void DoMenu() {
case ITEM2: case ITEM2:
tftPrint(0, myLanguage[language][46], 155, 78, ActiveColor, ActiveColorSmooth, 28); tftPrint(0, myLanguage[language][46], 155, 78, ActiveColor, ActiveColorSmooth, 28);
if (region == 0) tftPrint(0, myLanguage[language][47], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_EU) tftPrint(0, myLanguage[language][47], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (region == 1) tftPrint(0, myLanguage[language][48], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_US) tftPrint(0, myLanguage[language][48], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM3: case ITEM3:
@@ -2075,6 +2103,13 @@ void DoMenu() {
case FM_BAND_FM: tftPrint(0, myLanguage[language][105], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break; case FM_BAND_FM: tftPrint(0, myLanguage[language][105], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
} }
break; break;
case ITEM10:
tftPrint(0, myLanguage[language][199], 155, 78, ActiveColor, ActiveColorSmooth, 28);
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(1, String((fmdeemphasis == DEEMPHASIS_50 ? FM_DEEMPHASIS_50 : FM_DEEMPHASIS_70), DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(1, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (fmdeemphasis != DEEMPHASIS_NONE) tftPrint(-1, "μs", 170, 118, ActiveColor, PrimaryColorSmooth, 28);
break;
} }
break; break;
+1
View File
@@ -76,6 +76,7 @@ extern byte CurrentTheme;
extern byte ECCold; extern byte ECCold;
extern byte fmdefaultstepsize; extern byte fmdefaultstepsize;
extern byte fmnb; extern byte fmnb;
extern byte fmdeemphasis;
extern byte amcodect; extern byte amcodect;
extern byte amcodectcount; extern byte amcodectcount;
extern byte amrfagc; extern byte amrfagc;
+33 -17
View File
@@ -1,6 +1,6 @@
// [number of languages][number of texts] // [number of languages][number of texts]
static const char* const myLanguage[16][199] = { static const char* const myLanguage[16][200] = {
{ "English", // English { "English", // English
"Rotary direction changed", // 1 "Rotary direction changed", // 1
"Please release button", // 2 "Please release button", // 2
@@ -199,7 +199,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Nederlands", // Dutch { "Nederlands", // Dutch
@@ -400,7 +401,8 @@ static const char* const myLanguage[16][199] = {
"VERBIND", // 195 "VERBIND", // 195
"Auto AF sorteren", // 196 "Auto AF sorteren", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Polski", // Polish { "Polski", // Polish
@@ -601,7 +603,8 @@ static const char* const myLanguage[16][199] = {
"LACZNOSC", // 195 "LACZNOSC", // 195
"Automat. sortowanie AF", // 196 "Automat. sortowanie AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Hrvatski", // Croatian { "Hrvatski", // Croatian
@@ -802,7 +805,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Ελληνικά", // Greek { "Ελληνικά", // Greek
@@ -1003,7 +1007,8 @@ static const char* const myLanguage[16][199] = {
"ΣΥΝΔΕΣΗ", // 195 "ΣΥΝΔΕΣΗ", // 195
"Αυτόματη ταξινόμηση AF", // 196 "Αυτόματη ταξινόμηση AF", // 196
"ID λίστας σταθμών", // 197 "ID λίστας σταθμών", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Romana", // Romanian { "Romana", // Romanian
@@ -1204,7 +1209,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Deutsch", // German { "Deutsch", // German
@@ -1405,7 +1411,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Czech", // Czech { "Czech", // Czech
@@ -1606,7 +1613,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Slovak", // Slovak { "Slovak", // Slovak
@@ -1807,7 +1815,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Français", // French { "Français", // French
@@ -2008,7 +2017,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Български", // Bulgarian { "Български", // Bulgarian
@@ -2209,7 +2219,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Русский", // Russian { "Русский", // Russian
@@ -2410,7 +2421,8 @@ static const char* const myLanguage[16][199] = {
"ПОДКЛЮЧЕНИЕ", // 195 "ПОДКЛЮЧЕНИЕ", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Українська", // Ukranian { "Українська", // Ukranian
@@ -2611,7 +2623,8 @@ static const char* const myLanguage[16][199] = {
"ПІДКЛЮЧЕННЯ", // 195 "ПІДКЛЮЧЕННЯ", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Italiano", // Italian { "Italiano", // Italian
@@ -2812,7 +2825,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
}, },
{ "Simplified Chinese", // Simplified Chinese { "Simplified Chinese", // Simplified Chinese
@@ -3013,7 +3027,8 @@ static const char* const myLanguage[16][199] = {
"CONNECT", // 195 "CONNECT", // 195
"自动排列AF", // 196 "自动排列AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM天线衰减" // 198 "AM天线衰减", // 198
"FM去加重" // 199
}, },
{ "Norsk", // Norwegian { "Norsk", // Norwegian
@@ -3214,7 +3229,8 @@ static const char* const myLanguage[16][199] = {
"TILKOBLE", // 195 "TILKOBLE", // 195
"Auto sort AF", // 196 "Auto sort AF", // 196
"Stationlist ID", // 197 "Stationlist ID", // 197
"AM ATT" // 198 "AM ATT", // 198
"FM deemphasis" // 199
} }
}; };