diff --git a/sa_core.c b/sa_core.c index e1eddb8..3373345 100644 --- a/sa_core.c +++ b/sa_core.c @@ -919,7 +919,7 @@ void toggle_normalize(void) extern float peakLevel; void set_actual_power(float o) // Set peak level to known value { - float new_offset = o - peakLevel + get_level_offset(); // calculate offset based on difference between measured peak level and known peak level + float new_offset = o - peakLevel + get_level_offset(); // offset based on difference between measured peak level and known peak level if (o == 100) new_offset = 0; if (setting.mode == M_HIGH) { config.high_level_offset = new_offset; @@ -1416,9 +1416,9 @@ static const struct { // RBWx10 step_delay offset_delay spur_gate (value divided by 1000) { 8500, 150, 50, 400, -90}, { 3000, 150, 50, 200, -95}, - { 1000, 300, 100, 100, -105}, - { 300, 400, 120, 100, -110}, - { 100, 600, 120, 100, -115}, + { 1000, 800, 100, 100, -105}, + { 300, 800, 120, 100, -110}, + { 100, 800, 120, 100, -115}, { 30, 1500, 300, 100, -120}, { 10, 5000, 600, 100, -122}, { 3, 19000, 3000, 100, -125} @@ -3534,7 +3534,6 @@ static uint8_t sweep_counter = 0; // Only used for HW refresh static bool sweep(bool break_on_operation) { float RSSI; - int16_t downslope; #ifdef __SI4432__ freq_t agc_peak_freq = 0; float agc_peak_rssi = -150; @@ -3552,9 +3551,7 @@ static bool sweep(bool break_on_operation) #ifdef TINYSA4 palClearLine(LINE_LED); #endif - downslope = true; // Initialize the peak search algorithm - temppeakLevel = -150; - float temp_min_level = 100; +// float temp_min_level = 100; // spur_old_stepdelay = 0; // shell_printf("\r\n"); @@ -3705,8 +3702,14 @@ static bool sweep(bool break_on_operation) } // -------------------------------- Scan finished, do all postprocessing -------------------- + float temp_min_level = 100; + if (MODE_INPUT(setting.mode)) { + int16_t downslope = true; // Initialize the peak search algorithm + temppeakLevel = -150; + + #ifdef __VBW__ // ------------------------ do VBW processing ------------------------------ if (setting.frequency_step) { @@ -3727,7 +3730,6 @@ static bool sweep(bool break_on_operation) } #endif - for (int i = 0; i < sweep_points; i++) { #if 0 diff --git a/si4468.c b/si4468.c index d572af2..f51dc42 100644 --- a/si4468.c +++ b/si4468.c @@ -1058,8 +1058,8 @@ static si446x_state_t SI4463_get_state(void) uint8_t state = SI4463_get_device_status(); #else -again: - SI4463_wait_for_cts(); +//again: +// SI4463_wait_for_cts(); uint8_t state = getFRR(SI446X_CMD_READ_FRR_B); #endif #if 0 // Only for debugging @@ -1551,7 +1551,7 @@ uint16_t force_rbw(int f) } SI4463_clear_int_status(); SI4463_short_start_rx(); // This can cause recalibration - SI4463_wait_for_cts(); +// SI4463_wait_for_cts(); set_RSSI_comp(); // prev_band = -1; SI4463_RSSI_correction = float_TO_PURE_RSSI(RBW_choices[f].RSSI_correction_x_10 - 1200)/10; // Set RSSI correction