diff --git a/app/spectrum.c b/app/spectrum.c index ac8ebc2..b364072 100644 --- a/app/spectrum.c +++ b/app/spectrum.c @@ -296,7 +296,8 @@ static void DeInitSpectrum() { } uint8_t GetBWRegValueForScan() { - return scanStepBWRegValues[settings.scanStepIndex]; + return scanStepBWRegValues[settings.scanStepIndex == S_STEP_100_0kHz ? 11 + : 0]; } uint8_t GetBWRegValueForListen() { @@ -459,6 +460,7 @@ static void ResetBlacklist() { static void RelaunchScan() { InitScan(); ResetPeak(); + lastStepsCount = 0; ToggleRX(false); #ifdef SPECTRUM_AUTOMATIC_SQUELCH settings.rssiTriggerLevel = RSSI_MAX_VALUE; @@ -481,7 +483,7 @@ static void UpdateScanInfo() { static void AutoTriggerLevel() { if (settings.rssiTriggerLevel == RSSI_MAX_VALUE) { - settings.rssiTriggerLevel = Clamp(mov.max + 8, 0, RSSI_MAX_VALUE); + settings.rssiTriggerLevel = Clamp(scanInfo.rssiMax + 4, 0, RSSI_MAX_VALUE); } } diff --git a/app/spectrum.h b/app/spectrum.h index 8769a8a..ccbff43 100644 --- a/app/spectrum.h +++ b/app/spectrum.h @@ -54,7 +54,7 @@ static const uint8_t gStepSettingToIndex[] = { [STEP_8_33kHz] = 7, }; -static const uint16_t scanStepBWRegValues[] = { +static const uint16_t scanStepBWRegValues[12] = { // RX RXw TX BW // 0b0 000 000 001 01 1000 // 1