getSI4432_RSSI_correction now integer

pull/4/head
DiSlord 6 years ago
parent 5991b6ab88
commit f87f94e65a

@ -1437,7 +1437,8 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking)
// Calculate the RSSI correction for later use
if (MODE_INPUT(setting.mode)){ // only cases where the value can change on 0 point of sweep
if (i == 0)
correct_RSSI_sweep = float_TO_PURE_RSSI(getSI4432_RSSI_correction()
correct_RSSI_sweep = getSI4432_RSSI_correction()
+ float_TO_PURE_RSSI(
+ get_level_offset()
+ get_attenuation()
- get_signal_path_loss()
@ -1447,7 +1448,7 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking)
}
// -------------------------------- Acquisition loop for one requested frequency covering spur avoidance and vbwsteps ------------------------
pureRSSI_t RSSI = float_TO_PURE_RSSI(-150.0);
pureRSSI_t RSSI = float_TO_PURE_RSSI(-150);
int t = 0;
do {
int offs = 0,sm;

@ -302,12 +302,12 @@ static RBW_t RBW_choices[] = {
{IF_BW(1,0,14), -10, 6207}
};
static float SI4432_RSSI_correction = -120.0;
static pureRSSI_t SI4432_RSSI_correction = float_TO_PURE_RSSI(-120);
uint16_t SI4432_force_RBW(int i)
{
SI4432_Write_Byte(SI4432_IF_FILTER_BW, RBW_choices[i].reg); // Write RBW settings to Si4432
SI4432_RSSI_correction = ((int)RBW_choices[i].RSSI_correction_x_10-1200)/10.0; // Set RSSI correction
SI4432_RSSI_correction = float_TO_PURE_RSSI(RBW_choices[i].RSSI_correction_x_10)/10 - 120; // Set RSSI correction
return RBW_choices[i].RBWx10; // RBW achieved by Si4432 in kHz * 10
}
@ -444,7 +444,7 @@ void SI4432_Fill(int s, int start)
#define MINIMUM_WAIT_FOR_RSSI 280
int SI4432_offset_delay = 300;
float getSI4432_RSSI_correction(void){
pureRSSI_t getSI4432_RSSI_correction(void){
return SI4432_RSSI_correction;
};

@ -114,7 +114,7 @@ void SI4432_Receive(void);
void SI4432_Init(void);
void SI4432_Drive(int);
float getSI4432_RSSI_correction(void);
pureRSSI_t getSI4432_RSSI_correction(void);
pureRSSI_t SI4432_RSSI(uint32_t i, int s);
#ifdef __SIMULATION__
float Simulated_SI4432_RSSI(uint32_t i, int s);

Loading…
Cancel
Save

Powered by TurnKey Linux.