Fix: Respect holdtime on DX scanner even when signal drops out
This commit is contained in:
+6
-3
@@ -101,6 +101,7 @@ bool RDSstatusold;
|
|||||||
bool rdsstereoold;
|
bool rdsstereoold;
|
||||||
bool rtcset;
|
bool rtcset;
|
||||||
bool scandxmode;
|
bool scandxmode;
|
||||||
|
bool scanholdflag;
|
||||||
bool scanholdonsignal;
|
bool scanholdonsignal;
|
||||||
bool scanmem;
|
bool scanmem;
|
||||||
bool scanmute;
|
bool scanmute;
|
||||||
@@ -855,11 +856,12 @@ void loop() {
|
|||||||
|
|
||||||
if (scandxmode) {
|
if (scandxmode) {
|
||||||
unsigned long waitTime = (scanhold == 0) ? 500 : (scanhold * 1000);
|
unsigned long waitTime = (scanhold == 0) ? 500 : (scanhold * 1000);
|
||||||
bool signalCondition = (USN < fmscansens * 30) && (WAM < 230) && (OStatus < 80) && (OStatus > -80);
|
if (!scanholdflag) scanholdflag = (USN < fmscansens * 30) && (WAM < 230) && (OStatus < 80) && (OStatus > -80);
|
||||||
bool bypassMillisCheck = scanholdonsignal && !signalCondition;
|
bool bypassMillisCheck = scanholdonsignal && !scanholdflag;
|
||||||
bool shouldScan = bypassMillisCheck || (!bypassMillisCheck && (millis() >= scantimer + waitTime));
|
bool shouldScan = bypassMillisCheck || (!bypassMillisCheck && (millis() >= scantimer + waitTime));
|
||||||
|
|
||||||
if (shouldScan) {
|
if (shouldScan) {
|
||||||
|
scanholdflag = false;
|
||||||
if (scanmem) {
|
if (scanmem) {
|
||||||
memorypos++;
|
memorypos++;
|
||||||
if (memorypos > scanstop) memorypos = scanstart;
|
if (memorypos > scanstop) memorypos = scanstart;
|
||||||
@@ -910,7 +912,7 @@ void loop() {
|
|||||||
if (RDSstatus && radio.rds.correctPI != 0) cancelDXScan();
|
if (RDSstatus && radio.rds.correctPI != 0) cancelDXScan();
|
||||||
break;
|
break;
|
||||||
case SIGNAL:
|
case SIGNAL:
|
||||||
if (signalCondition) cancelDXScan();
|
if (scanhold) cancelDXScan();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4594,6 +4596,7 @@ void endMenu() {
|
|||||||
|
|
||||||
void startFMDXScan() {
|
void startFMDXScan() {
|
||||||
initdxscan = true;
|
initdxscan = true;
|
||||||
|
scanholdflag = false;
|
||||||
for (byte i = 0; i < 100; i++) {
|
for (byte i = 0; i < 100; i++) {
|
||||||
rabbitearspi[i] = 0;
|
rabbitearspi[i] = 0;
|
||||||
rabbitearstime[i][0] = 0;
|
rabbitearstime[i][0] = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user