Added AGC setting

Note: Flash data will be reset!
This commit is contained in:
Sjef Verhoeven PE5PVB
2024-02-19 20:55:07 +01:00
parent 69058e1d0d
commit 1fb7d5a893
10 changed files with 160 additions and 82 deletions
+16 -6
View File
@@ -116,6 +116,7 @@ byte af_counterold;
byte aid_counterold; byte aid_counterold;
byte af; byte af;
byte afpagenr; byte afpagenr;
byte amagc;
byte amnb; byte amnb;
byte amscansens; byte amscansens;
byte audiomode; byte audiomode;
@@ -144,6 +145,7 @@ byte displayflip;
byte ECCold; byte ECCold;
byte eonptyold[20]; byte eonptyold[20];
byte EQset; byte EQset;
byte fmagc;
byte fmscansens; byte fmscansens;
byte fmdefaultstepsize; byte fmdefaultstepsize;
byte fmnb; byte fmnb;
@@ -151,7 +153,7 @@ byte fmdeemphasis;
byte freqfont; byte freqfont;
byte amcodect; byte amcodect;
byte amcodectcount; byte amcodectcount;
byte amrfagc; byte amgain;
byte freqoldcount; byte freqoldcount;
byte HighCutLevel; byte HighCutLevel;
byte HighCutOffset; byte HighCutOffset;
@@ -450,7 +452,7 @@ void setup() {
batteryoptions = EEPROM.readByte(EE_BYTE_BATTERY_OPTIONS); batteryoptions = EEPROM.readByte(EE_BYTE_BATTERY_OPTIONS);
amcodect = EEPROM.readByte(EE_BYTE_AM_CO_DECT); amcodect = EEPROM.readByte(EE_BYTE_AM_CO_DECT);
amcodectcount = EEPROM.readByte(EE_BYTE_AM_CO_DECT_COUNT); amcodectcount = EEPROM.readByte(EE_BYTE_AM_CO_DECT_COUNT);
amrfagc = EEPROM.readByte(EE_BYTE_AM_RF_AGC); amgain = EEPROM.readByte(EE_BYTE_AM_RF_GAIN);
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); fmdeemphasis = EEPROM.readByte(EE_BYTE_FM_DEEMPHASIS);
@@ -466,6 +468,8 @@ void setup() {
freqfont = EEPROM.readByte(EE_BYTE_FREQFONT); freqfont = EEPROM.readByte(EE_BYTE_FREQFONT);
CurrentSkin = EEPROM.readByte(EE_BYTE_SKIN); CurrentSkin = EEPROM.readByte(EE_BYTE_SKIN);
XDRGTKMuteScreen = EEPROM.readByte(EE_BYTE_XDRGTKMUTE); XDRGTKMuteScreen = EEPROM.readByte(EE_BYTE_XDRGTKMUTE);
fmagc = EEPROM.readByte(EE_BYTE_FMAGC);
amagc = EEPROM.readByte(EE_BYTE_AMAGC);
if (spispeed == SPI_SPEED_DEFAULT) tft.setSPISpeed(SPI_FREQUENCY / 1000000); else tft.setSPISpeed(spispeed * 10); if (spispeed == SPI_SPEED_DEFAULT) tft.setSPISpeed(SPI_FREQUENCY / 1000000); else tft.setSPISpeed(spispeed * 10);
LWLowEdgeSet = FREQ_LW_LOW_EDGE_MIN; LWLowEdgeSet = FREQ_LW_LOW_EDGE_MIN;
@@ -709,7 +713,7 @@ void setup() {
if (band > BAND_GAP) { if (band > BAND_GAP) {
radio.setAMCoChannel(amcodect, amcodectcount); radio.setAMCoChannel(amcodect, amcodectcount);
radio.setAMAttenuation(amrfagc); radio.setAMAttenuation(amgain);
} }
radio.setStereoLevel(StereoLevel); radio.setStereoLevel(StereoLevel);
@@ -725,6 +729,8 @@ void setup() {
radio.setAudio(audiomode); radio.setAudio(audiomode);
radio.setDeemphasis(fmdeemphasis); radio.setDeemphasis(fmdeemphasis);
radio.rds.region = region; radio.rds.region = region;
radio.setAGC(fmagc);
radio.setAMAGC(amagc);
LowLevelInit = true; LowLevelInit = true;
if (ConverterSet >= 200) { if (ConverterSet >= 200) {
@@ -1744,7 +1750,7 @@ void SelectBand() {
LimitAMFrequency(); LimitAMFrequency();
if (!externaltune) CheckBandForbiddenAM(); if (!externaltune) CheckBandForbiddenAM();
radio.SetFreqAM(frequency_AM); radio.SetFreqAM(frequency_AM);
radio.setAMAttenuation(amrfagc); radio.setAMAttenuation(amgain);
radio.setAMCoChannel(amcodect, amcodectcount); radio.setAMCoChannel(amcodect, amcodectcount);
doBW(); doBW();
if (!screenmute) { if (!screenmute) {
@@ -1948,7 +1954,7 @@ void ModeButtonPress() {
EEPROM.writeByte(EE_BYTE_BATTERY_OPTIONS, batteryoptions); EEPROM.writeByte(EE_BYTE_BATTERY_OPTIONS, batteryoptions);
EEPROM.writeByte(EE_BYTE_AM_CO_DECT, amcodect); EEPROM.writeByte(EE_BYTE_AM_CO_DECT, amcodect);
EEPROM.writeByte(EE_BYTE_AM_CO_DECT_COUNT, amcodectcount); EEPROM.writeByte(EE_BYTE_AM_CO_DECT_COUNT, amcodectcount);
EEPROM.writeByte(EE_BYTE_AM_RF_AGC, amrfagc); EEPROM.writeByte(EE_BYTE_AM_RF_GAIN, amgain);
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.writeByte(EE_BYTE_FM_DEEMPHASIS, fmdeemphasis);
@@ -1961,6 +1967,8 @@ void ModeButtonPress() {
EEPROM.writeByte(EE_BYTE_FREQFONT, freqfont); EEPROM.writeByte(EE_BYTE_FREQFONT, freqfont);
EEPROM.writeByte(EE_BYTE_SKIN, CurrentSkin); EEPROM.writeByte(EE_BYTE_SKIN, CurrentSkin);
EEPROM.writeByte(EE_BYTE_XDRGTKMUTE, XDRGTKMuteScreen); EEPROM.writeByte(EE_BYTE_XDRGTKMUTE, XDRGTKMuteScreen);
EEPROM.writeByte(EE_BYTE_FMAGC, fmagc);
EEPROM.writeByte(EE_BYTE_AMAGC, amagc);
EEPROM.commit(); EEPROM.commit();
if (af == 2) radio.rds.afreg = true; else radio.rds.afreg = false; if (af == 2) radio.rds.afreg = true; else radio.rds.afreg = false;
if (!usesquelch) radio.setUnMute(); if (!usesquelch) radio.setUnMute();
@@ -3599,7 +3607,7 @@ void DefaultSettings(byte userhardwaremodel) {
EEPROM.writeByte(EE_BYTE_BATTERY_OPTIONS, BATTERY_VALUE); EEPROM.writeByte(EE_BYTE_BATTERY_OPTIONS, BATTERY_VALUE);
EEPROM.writeByte(EE_BYTE_AM_CO_DECT, 100); EEPROM.writeByte(EE_BYTE_AM_CO_DECT, 100);
EEPROM.writeByte(EE_BYTE_AM_CO_DECT_COUNT, 3); EEPROM.writeByte(EE_BYTE_AM_CO_DECT_COUNT, 3);
EEPROM.writeByte(EE_BYTE_AM_RF_AGC, 0); EEPROM.writeByte(EE_BYTE_AM_RF_GAIN, 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.writeByte(EE_BYTE_FM_DEEMPHASIS, DEEMPHASIS_50);
@@ -3615,6 +3623,8 @@ void DefaultSettings(byte userhardwaremodel) {
EEPROM.writeByte(EE_BYTE_FREQFONT, 3); EEPROM.writeByte(EE_BYTE_FREQFONT, 3);
EEPROM.writeByte(EE_BYTE_SKIN, 0); EEPROM.writeByte(EE_BYTE_SKIN, 0);
EEPROM.writeByte(EE_BYTE_XDRGTKMUTE, 0); EEPROM.writeByte(EE_BYTE_XDRGTKMUTE, 0);
EEPROM.writeByte(EE_BYTE_FMAGC, 92);
EEPROM.writeByte(EE_BYTE_AMAGC, 100);
EEPROM.commit(); EEPROM.commit();
} }
+5 -4
View File
@@ -254,10 +254,11 @@ void TEF6686::setUnMute() {
} }
void TEF6686::setAGC(uint8_t agc) { void TEF6686::setAGC(uint8_t agc) {
if (agc == 0) devTEF_Radio_Set_RFAGC(920); devTEF_Radio_Set_RFAGC(agc);
if (agc == 1) devTEF_Radio_Set_RFAGC(900); }
if (agc == 2) devTEF_Radio_Set_RFAGC(870);
if (agc == 3) devTEF_Radio_Set_RFAGC(840); void TEF6686::setAMAGC(uint8_t agc) {
devTEF_Radio_Set_AMRFAGC(agc);
} }
void TEF6686::setDeemphasis(uint8_t timeconstant) { void TEF6686::setDeemphasis(uint8_t timeconstant) {
+1
View File
@@ -674,6 +674,7 @@ class TEF6686 {
void clearRDS(bool fullsearchrds); void clearRDS(bool fullsearchrds);
void power(bool mode); void power(bool mode);
void setAGC(uint8_t agc); void setAGC(uint8_t agc);
void setAMAGC(uint8_t agc);
void setiMS(bool mph); void setiMS(bool mph);
void setEQ(bool eq); void setEQ(bool eq);
void setDeemphasis(uint8_t timeconstant); void setDeemphasis(uint8_t timeconstant);
+4
View File
@@ -140,6 +140,10 @@ void devTEF_Radio_Set_RFAGC(uint16_t agc) {
devTEF_Set_Cmd(TEF_FM, Cmd_Set_RFAGC, 7, agc, 0); devTEF_Set_Cmd(TEF_FM, Cmd_Set_RFAGC, 7, agc, 0);
} }
void devTEF_Radio_Set_AMRFAGC(uint16_t agc) {
devTEF_Set_Cmd(TEF_AM, Cmd_Set_RFAGC, 7, agc, 0);
}
void devTEF_Radio_Set_Deemphasis(uint16_t timeconstant) { void devTEF_Radio_Set_Deemphasis(uint16_t timeconstant) {
devTEF_Set_Cmd(TEF_FM, Cmd_Set_Deemphasis, 5, timeconstant); devTEF_Set_Cmd(TEF_FM, Cmd_Set_Deemphasis, 5, timeconstant);
} }
+1
View File
@@ -84,6 +84,7 @@ void devTEF_Radio_Set_Stereo_Min(bool mode);
void devTEF_Radio_Set_MphSuppression(bool mph); void devTEF_Radio_Set_MphSuppression(bool mph);
void devTEF_Radio_Set_ChannelEqualizer(bool eq); void devTEF_Radio_Set_ChannelEqualizer(bool eq);
void devTEF_Radio_Set_RFAGC(uint16_t agc); void devTEF_Radio_Set_RFAGC(uint16_t agc);
void devTEF_Radio_Set_AMRFAGC(uint16_t agc);
void devTEF_Radio_Set_Deemphasis(uint16_t timeconstant); void devTEF_Radio_Set_Deemphasis(uint16_t timeconstant);
void devTEF_Radio_Specials(uint16_t audio); void devTEF_Radio_Specials(uint16_t audio);
void devTEF_APPL_Set_StereoImprovement(bool mode); void devTEF_APPL_Set_StereoImprovement(bool mode);
+6 -1
View File
@@ -223,7 +223,12 @@ void XDRGTKRoutine() {
int AGC; int AGC;
AGC = atol(buff + 1); AGC = atol(buff + 1);
DataPrint("A" + String(AGC) + "\n"); DataPrint("A" + String(AGC) + "\n");
radio.setAGC(AGC); switch (AGC) {
case 0: if (band == BAND_FM || BAND_OIRT) radio.setAGC(92); else radio.setAMAGC(102); break;
case 1: if (band == BAND_FM || BAND_OIRT) radio.setAGC(90); else radio.setAMAGC(99); break;
case 2: if (band == BAND_FM || BAND_OIRT) radio.setAGC(87); else radio.setAMAGC(96); break;
case 3: if (band == BAND_FM || BAND_OIRT) radio.setAGC(84); else radio.setAMAGC(94); break;
}
break; break;
case 'C': case 'C':
+9 -7
View File
@@ -196,9 +196,9 @@
// EEPROM index defines // EEPROM index defines
#define EE_PRESETS_CNT 99 #define EE_PRESETS_CNT 99
#define EE_CHECKBYTE_VALUE 3 // 0 ~ 255,add new entry, change for new value #define EE_CHECKBYTE_VALUE 4 // 0 ~ 255,add new entry, change for new value
#define EE_TOTAL_CNT 824 #define EE_TOTAL_CNT 826
#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
@@ -260,7 +260,7 @@
#define EE_BYTE_BATTERY_OPTIONS 73 #define EE_BYTE_BATTERY_OPTIONS 73
#define EE_BYTE_AM_CO_DECT 74 #define EE_BYTE_AM_CO_DECT 74
#define EE_BYTE_AM_CO_DECT_COUNT 75 #define EE_BYTE_AM_CO_DECT_COUNT 75
#define EE_BYTE_AM_RF_AGC 76 #define EE_BYTE_AM_RF_GAIN 76
#define EE_BYTE_FM_DEEMPHASIS 77 #define EE_BYTE_FM_DEEMPHASIS 77
#define EE_UINT16_FREQUENCY_LW 78 #define EE_UINT16_FREQUENCY_LW 78
#define EE_UINT16_FREQUENCY_MW 82 #define EE_UINT16_FREQUENCY_MW 82
@@ -279,10 +279,12 @@
#define EE_BYTE_FREQFONT 124 #define EE_BYTE_FREQFONT 124
#define EE_BYTE_SKIN 125 #define EE_BYTE_SKIN 125
#define EE_BYTE_XDRGTKMUTE 126 #define EE_BYTE_XDRGTKMUTE 126
#define EE_PRESETS_BAND_START 127 #define EE_BYTE_FMAGC 127
#define EE_PRESET_BW_START 227 #define EE_BYTE_AMAGC 128
#define EE_PRESET_MS_START 327 #define EE_PRESETS_BAND_START 129
#define EE_PRESETS_START 427 #define EE_PRESET_BW_START 229
#define EE_PRESET_MS_START 329
#define EE_PRESETS_START 429
#define EE_PRESETS_FREQUENCY 0 #define EE_PRESETS_FREQUENCY 0
// End of EEPROM index defines // End of EEPROM index defines
+77 -25
View File
@@ -8,7 +8,7 @@
byte menuitem; byte menuitem;
byte items[8] = {8, static_cast<byte>(dynamicspi ? 5 : 4), 7, 10, 9, 10, 10, 6}; byte items[8] = {8, static_cast<byte>(dynamicspi ? 7 : 6), 7, 10, 9, 10, 10, 6};
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) {
@@ -509,6 +509,9 @@ void BuildMenu() {
tftPrint(-1, myLanguage[language][107], 8, ITEM2 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][107], 8, ITEM2 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][75], 8, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][75], 8, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][62], 8, ITEM4 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][62], 8, ITEM4 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][37], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][198], 8, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16);
switch (hardwaremodel) { switch (hardwaremodel) {
case BASE_ILI9341: tftPrint(1, myLanguage[language][109], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); break; case BASE_ILI9341: tftPrint(1, myLanguage[language][109], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); break;
@@ -520,12 +523,16 @@ void BuildMenu() {
if (tot != 0) tftPrint(1, String(tot), 270, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (tot != 0) tftPrint(1, String(tot), 270, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (tot != 0) tftPrint(1, myLanguage[language][80], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (tot != 0) tftPrint(1, myLanguage[language][80], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (usesquelch) tftPrint(1, myLanguage[language][42], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (usesquelch) tftPrint(1, myLanguage[language][42], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "dB", 310, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, "dB", 310, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, String(fmagc, DEC), 270, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, String(amagc, DEC), 270, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (dynamicspi) { if (dynamicspi) {
tftPrint(1, "MHz", 310, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(1, "MHz", 310, ITEM7 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][81], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][81], 8, ITEM7 + 6, ActiveColor, ActiveColorSmooth, 16);
if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][204]) + " " + 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, ITEM7 + 6, PrimaryColor, PrimaryColorSmooth, 16);
else tftPrint(1, String(spispeed * 10, DEC), 270, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, String(spispeed * 10, DEC), 270, ITEM7 + 6, PrimaryColor, PrimaryColorSmooth, 16);
} }
break; break;
@@ -676,7 +683,7 @@ void BuildMenu() {
tftPrint(-1, myLanguage[language][59], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][59], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][185], 8, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][185], 8, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][187], 8, ITEM7 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][187], 8, ITEM7 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][198], 8, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][36], 8, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][169], 8, ITEM9 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][169], 8, ITEM9 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][82], 8, ITEM10 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][82], 8, ITEM10 + 6, ActiveColor, ActiveColorSmooth, 16);
@@ -685,7 +692,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, PrimaryColor, PrimaryColorSmooth, 16); if (amgain != 0) tftPrint(1, "dB", 310, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM8 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "kHz", 310, ITEM9 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(1, "kHz", 310, ITEM9 + 6, ActiveColor, ActiveColorSmooth, 16);
switch (bandAM) { switch (bandAM) {
@@ -703,7 +710,7 @@ void BuildMenu() {
if (amcodect != 0) tftPrint(1, "%", 310, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16); if (amcodect != 0) tftPrint(1, "%", 310, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16);
if (amcodect != 0) tftPrint(1, String(amcodect, DEC), 270, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (amcodect != 0) tftPrint(1, String(amcodect, DEC), 270, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, String(amcodectcount, DEC), 310, ITEM7 + 6, PrimaryColor, PrimaryColorSmooth, 16); tftPrint(1, String(amcodectcount, DEC), 310, ITEM7 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (amrfagc != 0) tftPrint(1, String(amrfagc, DEC), 270, ITEM8 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (amgain != 0) tftPrint(1, String(amgain, DEC), 270, ITEM8 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (mwstepsize) tftPrint(1, "10", 270, ITEM9 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, "9", 270, ITEM9 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (mwstepsize) tftPrint(1, "10", 270, ITEM9 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, "9", 270, ITEM9 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, String(amscansens), 310, ITEM10 + 6, PrimaryColor, PrimaryColorSmooth, 16); tftPrint(1, String(amscansens), 310, ITEM10 + 6, PrimaryColor, PrimaryColorSmooth, 16);
break; break;
@@ -1066,6 +1073,22 @@ void MenuUp() {
break; break;
case ITEM5: case ITEM5:
tftPrint(1, String(fmagc), 155, 118, BackgroundColor, BackgroundColor, 28);
fmagc++;
if (fmagc > 92) fmagc = 84;
tftPrint(1, String(fmagc), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
radio.setAGC(fmagc);
break;
case ITEM6:
tftPrint(1, String(amagc), 155, 118, BackgroundColor, BackgroundColor, 28);
amagc++;
if (amagc > 102) amagc = 94;
tftPrint(1, String(amagc), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
radio.setAMAGC(amagc);
break;
case ITEM7:
if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][204]) + " " + 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); else tftPrint(1, String(spispeed * 10, DEC), 155, 118, BackgroundColor, BackgroundColor, 28);
@@ -1528,13 +1551,13 @@ void MenuUp() {
break; break;
case ITEM8: case ITEM8:
if (amrfagc != 0) tftPrint(1, String(amrfagc, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28); if (amgain != 0) tftPrint(1, String(amgain, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (amrfagc != 0) tftPrint(-1, "dB", 170, 118, BackgroundColor, BackgroundColor, 28); if (amgain != 0) tftPrint(-1, "dB", 170, 118, BackgroundColor, BackgroundColor, 28);
amrfagc += 6; amgain += 6;
if (amrfagc > 36) amrfagc = 0; if (amgain > 36) amgain = 0;
if (amrfagc != 0) tftPrint(1, String(amrfagc, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (amgain != 0) tftPrint(1, String(amgain, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (amrfagc != 0) tftPrint(-1, "dB", 170, 118, ActiveColor, ActiveColorSmooth, 28); if (amgain != 0) tftPrint(-1, "dB", 170, 118, ActiveColor, ActiveColorSmooth, 28);
if (band > BAND_GAP) radio.setAMAttenuation(amrfagc); if (band > BAND_GAP) radio.setAMAttenuation(amgain);
break; break;
case ITEM9: case ITEM9:
@@ -1663,6 +1686,22 @@ void MenuDown() {
break; break;
case ITEM5: case ITEM5:
tftPrint(1, String(fmagc), 155, 118, BackgroundColor, BackgroundColor, 28);
fmagc--;
if (fmagc < 84) fmagc = 92;
tftPrint(1, String(fmagc), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
radio.setAGC(fmagc);
break;
case ITEM6:
tftPrint(1, String(amagc), 155, 118, BackgroundColor, BackgroundColor, 28);
amagc--;
if (amagc < 94) amagc = 102;
tftPrint(1, String(amagc), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
radio.setAMAGC(amagc);
break;
case ITEM7:
if (spispeed == SPI_SPEED_DEFAULT) tftPrint(1, String(myLanguage[language][204]) + " " + 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); else tftPrint(1, String(spispeed * 10, DEC), 155, 118, BackgroundColor, BackgroundColor, 28);
@@ -2125,13 +2164,13 @@ void MenuDown() {
break; break;
case ITEM8: case ITEM8:
if (amrfagc != 0) tftPrint(1, String(amrfagc, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28); if (amgain != 0) tftPrint(1, String(amgain, DEC), 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (amrfagc != 0) tftPrint(-1, "dB", 170, 118, BackgroundColor, BackgroundColor, 28); if (amgain != 0) tftPrint(-1, "dB", 170, 118, BackgroundColor, BackgroundColor, 28);
amrfagc -= 6; amgain -= 6;
if (amrfagc > 36) amrfagc = 36; if (amgain > 36) amgain = 36;
if (amrfagc != 0) tftPrint(1, String(amrfagc, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (amgain != 0) tftPrint(1, String(amgain, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (amrfagc != 0) tftPrint(-1, "dB", 170, 118, ActiveColor, ActiveColorSmooth, 28); if (amgain != 0) tftPrint(-1, "dB", 170, 118, ActiveColor, ActiveColorSmooth, 28);
if (band > BAND_GAP) radio.setAMAttenuation(amrfagc); if (band > BAND_GAP) radio.setAMAttenuation(amgain);
break; break;
case ITEM9: case ITEM9:
@@ -2312,6 +2351,19 @@ void DoMenu() {
break; break;
case ITEM5: case ITEM5:
Infoboxprint(myLanguage[language][37]);
tftPrint(-1, "dB", 170, 118, ActiveColor, ActiveColorSmooth, 28);
tftPrint(1, String(fmagc), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
case ITEM6:
Infoboxprint(myLanguage[language][198]);
tftPrint(-1, "dB", 170, 118, ActiveColor, ActiveColorSmooth, 28);
tftPrint(1, String(amagc), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
case ITEM7:
Infoboxprint(myLanguage[language][81]); Infoboxprint(myLanguage[language][81]);
tftPrint(-1, "MHz", 170, 118, ActiveColor, ActiveColorSmooth, 28); tftPrint(-1, "MHz", 170, 118, ActiveColor, ActiveColorSmooth, 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) 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);
@@ -2612,9 +2664,9 @@ void DoMenu() {
break; break;
case ITEM8: case ITEM8:
Infoboxprint(myLanguage[language][198]); Infoboxprint(myLanguage[language][36]);
if (amrfagc != 0) tftPrint(-1, "dB", 170, 118, ActiveColor, ActiveColorSmooth, 28); if (amgain != 0) tftPrint(-1, "dB", 170, 118, ActiveColor, ActiveColorSmooth, 28);
if (amrfagc != 0) tftPrint(1, String(amrfagc, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (amgain != 0) tftPrint(1, String(amgain, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM9: case ITEM9:
+3 -1
View File
@@ -63,6 +63,7 @@ extern bool wifi;
extern byte af; extern byte af;
extern byte af_counterold; extern byte af_counterold;
extern byte afpagenr; extern byte afpagenr;
extern byte amagc;
extern byte amnb; extern byte amnb;
extern byte amscansens; extern byte amscansens;
extern byte audiomode; extern byte audiomode;
@@ -77,6 +78,7 @@ extern byte ContrastSet;
extern byte CurrentSkin; extern byte CurrentSkin;
extern byte CurrentTheme; extern byte CurrentTheme;
extern byte ECCold; extern byte ECCold;
extern byte fmagc;
extern byte fmscansens; extern byte fmscansens;
extern byte fmdefaultstepsize; extern byte fmdefaultstepsize;
extern byte fmnb; extern byte fmnb;
@@ -84,7 +86,7 @@ extern byte fmdeemphasis;
extern byte freqfont; extern byte freqfont;
extern byte amcodect; extern byte amcodect;
extern byte amcodectcount; extern byte amcodectcount;
extern byte amrfagc; extern byte amgain;
extern byte hardwaremodel; extern byte hardwaremodel;
extern byte hardwaremodelold; extern byte hardwaremodelold;
extern byte HighCutLevel; extern byte HighCutLevel;
+36 -36
View File
@@ -42,8 +42,8 @@ static const char* const myLanguage[18][206] = {
"OFF", // 33 "OFF", // 33
"SCANNING...", // 34 "SCANNING...", // 34
"Tuner not detected", // 35 "Tuner not detected", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Show RDS errors", // 38 "Show RDS errors", // 38
"Language", // 39 "Language", // 39
"Choose language", // 40 "Choose language", // 40
@@ -250,8 +250,8 @@ static const char* const myLanguage[18][206] = {
"UIT", // 33 "UIT", // 33
"ZOEKEN...", // 34 "ZOEKEN...", // 34
"Tuner niet herkend!", // 35 "Tuner niet herkend!", // 35
"", // 36 "AM antenne versterking", // 36
"", // 37 "FM AGC", // 37
"Toon RDS fouten", // 38 "Toon RDS fouten", // 38
"Taal", // 39 "Taal", // 39
"Kies taal", // 40 "Kies taal", // 40
@@ -458,8 +458,8 @@ static const char* const myLanguage[18][206] = {
"WYŁ.", // 33 "WYŁ.", // 33
"SKANOWANIE...", // 34 "SKANOWANIE...", // 34
"Nie wykryto tunera", // 35 "Nie wykryto tunera", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Pokaż błędy RDS", // 38 "Pokaż błędy RDS", // 38
"Język", // 39 "Język", // 39
"Wybierz swój język", // 40 "Wybierz swój język", // 40
@@ -666,8 +666,8 @@ static const char* const myLanguage[18][206] = {
"ISK.", // 33 "ISK.", // 33
"SKENIRANJE...", // 34 "SKENIRANJE...", // 34
"Prijemnik nije pronađen", // 35 "Prijemnik nije pronađen", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Prikaži RDS pogreške", // 38 "Prikaži RDS pogreške", // 38
"Jezik", // 39 "Jezik", // 39
"Odaberite jezik", // 40 "Odaberite jezik", // 40
@@ -874,8 +874,8 @@ static const char* const myLanguage[18][206] = {
"ΑΝΕΝ.", // 33 "ΑΝΕΝ.", // 33
"ΑΝΙΧΝΕΥΣΗ...", // 34 "ΑΝΙΧΝΕΥΣΗ...", // 34
"Το tuner δεν εντοπίστηκε", // 35 "Το tuner δεν εντοπίστηκε", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Περιθώριο σφαλμάτων\nRDS", // 38 "Περιθώριο σφαλμάτων\nRDS", // 38
"Γλώσσα", // 39 "Γλώσσα", // 39
"Επιλογή γλώσσας", // 40 "Επιλογή γλώσσας", // 40
@@ -1082,8 +1082,8 @@ static const char* const myLanguage[18][206] = {
"Oprit", // 33 "Oprit", // 33
"SCANEZ...", // 34 "SCANEZ...", // 34
"Tunerul nu este prezent", // 35 "Tunerul nu este prezent", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Arata erorile RDS", // 38 "Arata erorile RDS", // 38
"Limba", // 39 "Limba", // 39
"Alegeti Limba", // 40 "Alegeti Limba", // 40
@@ -1290,8 +1290,8 @@ static const char* const myLanguage[18][206] = {
"AUS", // 33 "AUS", // 33
"SCANNE...", // 34 "SCANNE...", // 34
"Tuner nicht erkannt", // 35 "Tuner nicht erkannt", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Zeige RDS Fehler", // 38 "Zeige RDS Fehler", // 38
"Sprache", // 39 "Sprache", // 39
"Sprache wählen", // 40 "Sprache wählen", // 40
@@ -1498,8 +1498,8 @@ static const char* const myLanguage[18][206] = {
"VYP", // 33 "VYP", // 33
"SKENUJI...", // 34 "SKENUJI...", // 34
"Tuner nedetekován", // 35 "Tuner nedetekován", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Zobrazit chyby v RDS", // 38 "Zobrazit chyby v RDS", // 38
"Jazyk", // 39 "Jazyk", // 39
"Vyberte jazyk", // 40 "Vyberte jazyk", // 40
@@ -1706,8 +1706,8 @@ static const char* const myLanguage[18][206] = {
"VYP", // 33 "VYP", // 33
"SKENUJEM...", // 34 "SKENUJEM...", // 34
"Tuner nedetekovaný", // 35 "Tuner nedetekovaný", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Zobraziť chyby v RDS", // 38 "Zobraziť chyby v RDS", // 38
"Jazyk", // 39 "Jazyk", // 39
"Vyberte jazyk", // 40 "Vyberte jazyk", // 40
@@ -1914,8 +1914,8 @@ static const char* const myLanguage[18][206] = {
"FERMÉ", // 33 "FERMÉ", // 33
"RECHERCHE...", // 34 "RECHERCHE...", // 34
"Tuner non détecté", // 35 "Tuner non détecté", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Montrer les erreurs\nde décodage RDS", // 38 "Montrer les erreurs\nde décodage RDS", // 38
"Langage", // 39 "Langage", // 39
"Choix de la langue", // 40 "Choix de la langue", // 40
@@ -2122,8 +2122,8 @@ static const char* const myLanguage[18][206] = {
"ИЗКЛ.", // 33 "ИЗКЛ.", // 33
"СКАНИРАНЕ", // 34 "СКАНИРАНЕ", // 34
"Тунерът не е разпознат!", // 35 "Тунерът не е разпознат!", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Показване на RDS грешки", // 38 "Показване на RDS грешки", // 38
"Език", // 39 "Език", // 39
"Изберете език", // 40 "Изберете език", // 40
@@ -2330,8 +2330,8 @@ static const char* const myLanguage[18][206] = {
"ВЫКЛ.", // 33 "ВЫКЛ.", // 33
"СКАНИРОВАНИЕ...", // 34 "СКАНИРОВАНИЕ...", // 34
"Тюнер не обнаружен", // 35 "Тюнер не обнаружен", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Уровень ошибок RDS", // 38 "Уровень ошибок RDS", // 38
"Язык меню", // 39 "Язык меню", // 39
"Язык меню: ", // 40 "Язык меню: ", // 40
@@ -2538,8 +2538,8 @@ static const char* const myLanguage[18][206] = {
"ВИМКН.", // 33 "ВИМКН.", // 33
"СКАНУВАННЯ...", // 34 "СКАНУВАННЯ...", // 34
"Тюнер не виявлено", // 35 "Тюнер не виявлено", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Показувати помилки RDS", // 38 "Показувати помилки RDS", // 38
"Мова", // 39 "Мова", // 39
"Виберіть мову", // 40 "Виберіть мову", // 40
@@ -2746,8 +2746,8 @@ static const char* const myLanguage[18][206] = {
"OFF", // 33 *** "OFF", // 33 ***
"SCANSIONE...", // 34 "SCANSIONE...", // 34
"Ricevitore non rilevato", // 35 "Ricevitore non rilevato", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Mostra errori RDS", // 38 "Mostra errori RDS", // 38
"Lingua", // 39 "Lingua", // 39
"Scegli la lingua", // 40 "Scegli la lingua", // 40
@@ -2954,8 +2954,8 @@ static const char* const myLanguage[18][206] = {
"OFF", // 33 *** "OFF", // 33 ***
"搜索中...", // 34 "搜索中...", // 34
"未检测到收音芯片", // 35 "未检测到收音芯片", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"显示 RDS errors", // 38 "显示 RDS errors", // 38
"语言", // 39 "语言", // 39
"选择语言", // 40 "选择语言", // 40
@@ -3162,8 +3162,8 @@ static const char* const myLanguage[18][206] = {
"AV", // 33 "AV", // 33
"SKANNER...", // 34 "SKANNER...", // 34
"Tuner ikke oppdaget", // 35 "Tuner ikke oppdaget", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Vis RDS-feil", // 38 "Vis RDS-feil", // 38
"Språk", // 39 "Språk", // 39
"Velg språk", // 40 "Velg språk", // 40
@@ -3370,8 +3370,8 @@ static const char* const myLanguage[18][206] = {
"APAGADO", // 33 "APAGADO", // 33
"ESCANEANDO...", // 34 "ESCANEANDO...", // 34
"Sintonizador no detectado", // 35 "Sintonizador no detectado", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Mostrar errores RDS", // 38 "Mostrar errores RDS", // 38
"Idioma", // 39 "Idioma", // 39
"Elegir idioma", // 40 "Elegir idioma", // 40
@@ -3578,8 +3578,8 @@ static const char* const myLanguage[18][206] = {
"DESATIVADO", // 33 "DESATIVADO", // 33
"ANALISANDO...", // 34 "ANALISANDO...", // 34
"Sintonizador não detectado", // 35 "Sintonizador não detectado", // 35
"", // 36 "AM Antenna gain", // 36
"", // 37 "FM AGC", // 37
"Mostrar erros RDS", // 38 "Mostrar erros RDS", // 38
"Idioma", // 39 "Idioma", // 39
"Escolha o idioma", // 40 "Escolha o idioma", // 40