Break RSSI and NFM 3kHz

pwm
erikkaashoek 3 years ago
parent 4ff093a816
commit 538aedf19c

@ -3329,7 +3329,7 @@ static int fm_modulation[MAX_MODULATION_STEPS+1];
// //
// Offset is 156.25Hz when below 600MHz and 312.5 when above. // 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 HND 6
#define LWD 240 // Total WFM deviation is LWD * 4 * 156.25 = 75kHz when below 600MHz #define LWD 240 // Total WFM deviation is LWD * 4 * 156.25 = 75kHz when below 600MHz
#define HWD 120 #define HWD 120
@ -4591,7 +4591,7 @@ again: // Spur redu
pureRSSI = DEVICE_TO_PURE_RSSI((deviceRSSI_t)SI4432_Read_Byte(SI4432_REG_RSSI)); pureRSSI = DEVICE_TO_PURE_RSSI((deviceRSSI_t)SI4432_Read_Byte(SI4432_REG_RSSI));
#endif #endif
#ifdef __SI4463__ #ifdef __SI4463__
pureRSSI = Si446x_RSSI(); pureRSSI = Si446x_RSSI(break_on_operation);
if (LO_shifting) 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)); 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 //else
{ {
#ifdef __SI4432__ #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 #endif
#ifdef __SI4463__ #ifdef __SI4463__
if (real_old_freq[SI4463_RX] == 0) if (real_old_freq[SI4463_RX] == 0)
pureRSSI = 0; pureRSSI = 0;
else { else {
pureRSSI = Si446x_RSSI(); pureRSSI = Si446x_RSSI(break_on_operation);
if (LO_shifting) 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)); 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));
} }

@ -784,7 +784,7 @@ pureRSSI_t getSI4432_RSSI_correction(void){
return SI4432_RSSI_correction; 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; (void) i;
int32_t RSSI_RAW; 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)); RSSI_RAW += DEVICE_TO_PURE_RSSI((deviceRSSI_t)SI4432_Read_Byte(SI4432_REG_RSSI));
if (--i == 0) break; if (--i == 0) break;
my_microsecond_delay(100); my_microsecond_delay(100);
if (break_on_operation && operation_requested)
break;
}while(1); }while(1);
if (setting.repeat > 1){ if (setting.repeat > 1){

@ -129,7 +129,7 @@ void SI4432_Reset(void);
void SI4432_Init(void); void SI4432_Init(void);
void SI4432_Drive(int); void SI4432_Drive(int);
pureRSSI_t getSI4432_RSSI_correction(void); 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__ #ifdef __SIMULATION__
float Simulated_SI4432_RSSI(uint32_t i, int s); float Simulated_SI4432_RSSI(uint32_t i, int s);
#endif #endif
@ -184,7 +184,7 @@ extern int si5351_available;
#ifdef __SI4463__ #ifdef __SI4463__
#include "si446x_defs.h" #include "si446x_defs.h"
#include "si446x.h" #include "si446x.h"
int16_t Si446x_RSSI(void); int16_t Si446x_RSSI(bool break_on_operation);
uint8_t getFRR(uint8_t reg); uint8_t getFRR(uint8_t reg);
si446x_state_t getState(void); si446x_state_t getState(void);
void setState(si446x_state_t newState); void setState(si446x_state_t newState);

@ -1633,7 +1633,7 @@ void SI4432_Listen(int s)
#endif #endif
int16_t Si446x_RSSI(void) int16_t Si446x_RSSI(bool break_on_operation)
{ {
#ifdef __FAST_SWEEP__ #ifdef __FAST_SWEEP__
if (buf_read) { if (buf_read) {
@ -1696,6 +1696,8 @@ int16_t Si446x_RSSI(void)
if (--i <= 0) break; if (--i <= 0) break;
if (setting.repeat > 1) if (setting.repeat > 1)
my_microsecond_delay(SI4432_step_delay); my_microsecond_delay(SI4432_step_delay);
if (break_on_operation && operation_requested)
break;
}while(1); }while(1);
if (setting.repeat > 1 && setting.exp_aver == 1) if (setting.repeat > 1 && setting.exp_aver == 1)

@ -2076,7 +2076,7 @@ const char *menu_modulation_text[MO_MAX]=
"FM 3kHz", "FM 3kHz",
"FM 5kHz", "FM 5kHz",
#else #else
"FM 4kHz", "FM 3kHz",
#endif #endif
"FM 75kHz", "External"}; "FM 75kHz", "External"};

Loading…
Cancel
Save

Powered by TurnKey Linux.