Skip to content

Commit

Permalink
fix: fastfix for autolevel
Browse files Browse the repository at this point in the history
  • Loading branch information
fagci committed Oct 5, 2023
1 parent 61ac21a commit d988003
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/spectrum.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d988003

Please sign in to comment.