Added option to clear memory range
Cancel button for auto memory changed to mode button
This commit is contained in:
+12
-4
@@ -4644,8 +4644,6 @@ uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, ui
|
|||||||
tft.fillRect(66, 110, 188, 6, GreyoutColor);
|
tft.fillRect(66, 110, 188, 6, GreyoutColor);
|
||||||
tftPrint(1, myLanguage[language][272], 120, 155, ActiveColor, ActiveColorSmooth, 16);
|
tftPrint(1, myLanguage[language][272], 120, 155, ActiveColor, ActiveColorSmooth, 16);
|
||||||
|
|
||||||
while (digitalRead(ROTARY_BUTTON)) delay(50);
|
|
||||||
|
|
||||||
for (frequency = startfreq * 10; frequency <= stopfreq * 10; frequency += 10) {
|
for (frequency = startfreq * 10; frequency <= stopfreq * 10; frequency += 10) {
|
||||||
if (stopScanning) {
|
if (stopScanning) {
|
||||||
break;
|
break;
|
||||||
@@ -4704,8 +4702,8 @@ uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, ui
|
|||||||
|
|
||||||
percentold = percent;
|
percentold = percent;
|
||||||
}
|
}
|
||||||
if (digitalRead(ROTARY_BUTTON) == LOW) {
|
if (digitalRead(MODEBUTTON) == LOW) {
|
||||||
while (digitalRead(ROTARY_BUTTON)) delay(50);
|
while (digitalRead(MODEBUTTON)) delay(50);
|
||||||
error = 2;
|
error = 2;
|
||||||
stopScanning = true;
|
stopScanning = true;
|
||||||
break;
|
break;
|
||||||
@@ -4771,3 +4769,13 @@ void StoreMemoryPos(uint8_t _pos) {
|
|||||||
presets[_pos].frequency = frequency_SW;
|
presets[_pos].frequency = frequency_SW;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClearMemoryRange(uint8_t start, uint8_t stop) {
|
||||||
|
for (uint8_t pos = start; pos <= stop; pos++) {
|
||||||
|
EEPROM.writeByte(pos + EE_PRESETS_BAND_START, BAND_FM);
|
||||||
|
EEPROM.writeUInt((pos * 4) + EE_PRESETS_FREQUENCY_START, EE_PRESETS_FREQUENCY);
|
||||||
|
EEPROM.commit();
|
||||||
|
presets[pos].band = BAND_FM;
|
||||||
|
presets[pos].frequency = EE_PRESETS_FREQUENCY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+22
-1
@@ -8,7 +8,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
byte menuitem;
|
byte menuitem;
|
||||||
byte items[10] = {10, static_cast<byte>(dynamicspi ? 10 : 9), 7, 10, 10, 10, 9, 6, 7, 6};
|
byte items[10] = {10, static_cast<byte>(dynamicspi ? 10 : 9), 7, 10, 10, 10, 9, 6, 7, 7};
|
||||||
extern mem presets[];
|
extern mem presets[];
|
||||||
bool setWiFiConnectParam = false;
|
bool setWiFiConnectParam = false;
|
||||||
|
|
||||||
@@ -1251,6 +1251,12 @@ void ShowOneLine(byte position, byte item, bool selected) {
|
|||||||
FullLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
|
FullLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
|
||||||
FullLineSprite.drawString((scanmute ? myLanguage[language][42] : myLanguage[language][30]), 298, 2);
|
FullLineSprite.drawString((scanmute ? myLanguage[language][42] : myLanguage[language][30]), 298, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AUTOMEM:
|
||||||
|
FullLineSprite.setTextDatum(TL_DATUM);
|
||||||
|
FullLineSprite.setTextColor(ActiveColor, ActiveColorSmooth, false);
|
||||||
|
FullLineSprite.drawString(removeNewline(myLanguage[language][276]), 6, 2);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -4533,6 +4539,21 @@ void DoMenu() {
|
|||||||
OneBigLineSprite.drawString((mempionly ? myLanguage[language][42] : myLanguage[language][30]), 135, 0);
|
OneBigLineSprite.drawString((mempionly ? myLanguage[language][42] : myLanguage[language][30]), 135, 0);
|
||||||
OneBigLineSprite.pushSprite(24, 118);
|
OneBigLineSprite.pushSprite(24, 118);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ITEM7:
|
||||||
|
Infoboxprint(myLanguage[language][276]);
|
||||||
|
|
||||||
|
ClearMemoryRange(memstartpos, memstoppos);
|
||||||
|
OneBigLineSprite.drawString(myLanguage[language][216], 135, 0);
|
||||||
|
OneBigLineSprite.pushSprite(24, 118);
|
||||||
|
|
||||||
|
switch (CurrentTheme) {
|
||||||
|
case 7: OneBigLineSprite.pushImage(-11, -118, 292, 170, popupbackground_wo); break;
|
||||||
|
default: OneBigLineSprite.pushImage(-11, -118, 292, 170, popupbackground); break;
|
||||||
|
}
|
||||||
|
OneBigLineSprite.drawString(String(memstartpos + 1) + " - " + String(memstoppos + 1) + " " + String(myLanguage[language][277]), 135, 0);
|
||||||
|
OneBigLineSprite.pushSprite(24, 148);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,4 +244,5 @@ extern void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, i
|
|||||||
extern void setAutoSpeedSPI();
|
extern void setAutoSpeedSPI();
|
||||||
extern void showAutoSquelch(bool mode);
|
extern void showAutoSquelch(bool mode);
|
||||||
extern uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, uint8_t stopmem, bool pisearch);
|
extern uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, uint8_t stopmem, bool pisearch);
|
||||||
|
extern void ClearMemoryRange(uint8_t start, uint8_t stop);
|
||||||
#endif
|
#endif
|
||||||
+55
-19
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
// [number of languages][number of texts]
|
// [number of languages][number of texts]
|
||||||
|
|
||||||
static const char* const myLanguage[18][276] PROGMEM = {
|
static const char* const myLanguage[18][278] PROGMEM = {
|
||||||
{ "English", // English
|
{ "English", // English
|
||||||
"Rotary direction changed", // 1
|
"Rotary direction changed", // 1
|
||||||
"Please release button", // 2
|
"Please release button", // 2
|
||||||
@@ -281,7 +281,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Nederlands", // Dutch
|
{ "Nederlands", // Dutch
|
||||||
@@ -559,7 +561,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Gevonden", // 272
|
"Gevonden", // 272
|
||||||
"Afgebroken! Geheugen vol", // 273
|
"Afgebroken! Geheugen vol", // 273
|
||||||
"Afgebroken! Knop ingedrukt", // 274
|
"Afgebroken! Knop ingedrukt", // 274
|
||||||
"Zoeken zonder fouten voltooid" // 275
|
"Zoeken zonder fouten voltooid", // 275
|
||||||
|
"Wis geheugenkanalen", // 276
|
||||||
|
"gewist" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Polski", // Polish
|
{ "Polski", // Polish
|
||||||
@@ -837,7 +841,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Hrvatski", // Croatian
|
{ "Hrvatski", // Croatian
|
||||||
@@ -1115,7 +1121,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Ελληνικά", // Greek
|
{ "Ελληνικά", // Greek
|
||||||
@@ -1393,7 +1401,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Română", // Romanian
|
{ "Română", // Romanian
|
||||||
@@ -1671,7 +1681,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Deutsch", // German
|
{ "Deutsch", // German
|
||||||
@@ -1949,7 +1961,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Český", // Czech
|
{ "Český", // Czech
|
||||||
@@ -2227,7 +2241,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Magyar", // Hungarian
|
{ "Magyar", // Hungarian
|
||||||
@@ -2505,7 +2521,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Français", // French
|
{ "Français", // French
|
||||||
@@ -2783,7 +2801,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Български", // Bulgarian
|
{ "Български", // Bulgarian
|
||||||
@@ -3061,7 +3081,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Русский", // Russian
|
{ "Русский", // Russian
|
||||||
@@ -3339,7 +3361,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Українська", // Ukranian
|
{ "Українська", // Ukranian
|
||||||
@@ -3617,7 +3641,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Italiano", // Italian
|
{ "Italiano", // Italian
|
||||||
@@ -3895,7 +3921,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Simplified Chinese", // Simplified Chinese
|
{ "Simplified Chinese", // Simplified Chinese
|
||||||
@@ -4173,7 +4201,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Norsk", // Norwegian
|
{ "Norsk", // Norwegian
|
||||||
@@ -4451,7 +4481,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Español", // Spanish
|
{ "Español", // Spanish
|
||||||
@@ -4729,7 +4761,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "Português", // Portuguese
|
{ "Português", // Portuguese
|
||||||
@@ -5007,7 +5041,9 @@ static const char* const myLanguage[18][276] PROGMEM = {
|
|||||||
"Found", // 272
|
"Found", // 272
|
||||||
"Abort! Out of memorychannels", // 273
|
"Abort! Out of memorychannels", // 273
|
||||||
"Abort! User pressed button", // 274
|
"Abort! User pressed button", // 274
|
||||||
"Scan finished without errors" // 275
|
"Scan finished without errors", // 275
|
||||||
|
"Clear memory channels", // 276
|
||||||
|
"cleared" // 277
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user