diff --git a/sa_core.c b/sa_core.c index 83306d2..115fd3f 100644 --- a/sa_core.c +++ b/sa_core.c @@ -3329,7 +3329,7 @@ static int fm_modulation[MAX_MODULATION_STEPS+1]; // // Offset is 156.25Hz when below 600MHz and 312.5 when above. // -#define LND 12 // Total NFM deviation is LND * 4 * 156.25 = 5kHz when below 600MHz or 600MHz - 434MHz +#define LND 10 // Total NFM deviation is LND * 4 * 156.25 = 5kHz when below 600MHz or 600MHz - 434MHz #define HND 6 #define LWD 240 // Total WFM deviation is LWD * 4 * 156.25 = 75kHz when below 600MHz #define HWD 120 @@ -4591,7 +4591,7 @@ again: // Spur redu pureRSSI = DEVICE_TO_PURE_RSSI((deviceRSSI_t)SI4432_Read_Byte(SI4432_REG_RSSI)); #endif #ifdef __SI4463__ - pureRSSI = Si446x_RSSI(); + pureRSSI = Si446x_RSSI(break_on_operation); if (LO_shifting) pureRSSI += float_TO_PURE_RSSI(actual_rbw_x10>USE_SHIFT2_RBW ? config.shift2_level_offset : (lf < LOW_SHIFT_FREQ ? config.shift1_level_offset: 0.0)); @@ -4684,13 +4684,13 @@ again: // Spur redu //else { #ifdef __SI4432__ - pureRSSI = SI4432_RSSI(lf, MODE_SELECT(setting.mode)); // Get RSSI, either from pre-filled buffer + pureRSSI = SI4432_RSSI(lf, MODE_SELECT(setting.mode), break_on_operation); // Get RSSI, either from pre-filled buffer #endif #ifdef __SI4463__ if (real_old_freq[SI4463_RX] == 0) pureRSSI = 0; else { - pureRSSI = Si446x_RSSI(); + pureRSSI = Si446x_RSSI(break_on_operation); if (LO_shifting) pureRSSI += float_TO_PURE_RSSI(actual_rbw_x10>USE_SHIFT2_RBW ? config.shift2_level_offset : (lf < LOW_SHIFT_FREQ ? config.shift1_level_offset: 0.0)); } diff --git a/si4432.c b/si4432.c index c920c7d..f7b8215 100644 --- a/si4432.c +++ b/si4432.c @@ -784,7 +784,7 @@ pureRSSI_t getSI4432_RSSI_correction(void){ return SI4432_RSSI_correction; }; -pureRSSI_t SI4432_RSSI(uint32_t i, int s) +pureRSSI_t SI4432_RSSI(uint32_t i, int s, bool break_on_operation) { (void) i; int32_t RSSI_RAW; @@ -826,6 +826,8 @@ pureRSSI_t SI4432_RSSI(uint32_t i, int s) RSSI_RAW += DEVICE_TO_PURE_RSSI((deviceRSSI_t)SI4432_Read_Byte(SI4432_REG_RSSI)); if (--i == 0) break; my_microsecond_delay(100); + if (break_on_operation && operation_requested) + break; }while(1); if (setting.repeat > 1){ diff --git a/si4432.h b/si4432.h index 459cbb9..bcf4f4c 100644 --- a/si4432.h +++ b/si4432.h @@ -129,7 +129,7 @@ void SI4432_Reset(void); void SI4432_Init(void); void SI4432_Drive(int); pureRSSI_t getSI4432_RSSI_correction(void); -pureRSSI_t SI4432_RSSI(uint32_t i, int s); +pureRSSI_t SI4432_RSSI(uint32_t i, int s, bool break_on_operation); #ifdef __SIMULATION__ float Simulated_SI4432_RSSI(uint32_t i, int s); #endif @@ -184,7 +184,7 @@ extern int si5351_available; #ifdef __SI4463__ #include "si446x_defs.h" #include "si446x.h" -int16_t Si446x_RSSI(void); +int16_t Si446x_RSSI(bool break_on_operation); uint8_t getFRR(uint8_t reg); si446x_state_t getState(void); void setState(si446x_state_t newState); diff --git a/si4468.c b/si4468.c index db7b98f..9ef22d1 100644 --- a/si4468.c +++ b/si4468.c @@ -1633,7 +1633,7 @@ void SI4432_Listen(int s) #endif -int16_t Si446x_RSSI(void) +int16_t Si446x_RSSI(bool break_on_operation) { #ifdef __FAST_SWEEP__ if (buf_read) { @@ -1696,6 +1696,8 @@ int16_t Si446x_RSSI(void) if (--i <= 0) break; if (setting.repeat > 1) my_microsecond_delay(SI4432_step_delay); + if (break_on_operation && operation_requested) + break; }while(1); if (setting.repeat > 1 && setting.exp_aver == 1) diff --git a/ui.c b/ui.c index ad76e6e..14815b5 100644 --- a/ui.c +++ b/ui.c @@ -2076,7 +2076,7 @@ const char *menu_modulation_text[MO_MAX]= "FM 3kHz", "FM 5kHz", #else - "FM 4kHz", + "FM 3kHz", #endif "FM 75kHz", "External"};