get_signal_path_loss correction use integer values

pull/4/head
DiSlord 6 years ago
parent 3abd5e1989
commit 84572dec56

@ -887,7 +887,7 @@ typedef int16_t pureRSSI_t;
// External programm zero level settings (need decrease on this value -)
#define EXT_ZERO_LEVEL (128)
#define DEVICE_TO_PURE_RSSI(rssi) ((rssi)<<4)
#define float_TO_PURE_RSSI(rssi) ((rssi)*32.0)
#define float_TO_PURE_RSSI(rssi) ((rssi)*32)
#define PURE_TO_float(rssi) ((rssi)/32.0)
extern uint16_t actual_rbw_x10;

@ -350,14 +350,14 @@ float get_attenuation(void)
return(setting.attenuate);
}
static float get_signal_path_loss(void){
static pureRSSI_t get_signal_path_loss(void){
#ifdef __ULTRA__
if (setting.mode == M_ULTRA)
return -15; // Loss in dB, -9.5 for v0.1, -12.5 for v0.2
return float_TO_PURE_RSSI(-15); // Loss in dB, -9.5 for v0.1, -12.5 for v0.2
#endif
if (setting.mode == M_LOW)
return -5.5; // Loss in dB, -9.5 for v0.1, -12.5 for v0.2
return +7; // Loss in dB (+ is gain)
return float_TO_PURE_RSSI(-5.5); // Loss in dB, -9.5 for v0.1, -12.5 for v0.2
return float_TO_PURE_RSSI(+7); // Loss in dB (+ is gain)
}
static const int drive_dBm [16] = {-38,-35,-33,-30,-27,-24,-21,-19,-7,-4,-2, 1, 4, 7, 10, 13};
@ -1438,10 +1438,10 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking)
if (MODE_INPUT(setting.mode)){ // only cases where the value can change on 0 point of sweep
if (i == 0){
correct_RSSI = getSI4432_RSSI_correction()
- get_signal_path_loss()
+ float_TO_PURE_RSSI(
+ get_level_offset()
+ get_attenuation()
- get_signal_path_loss()
- setting.offset);
}
if (i == 0 || setting.frequency_step != 0)

Loading…
Cancel
Save

Powered by TurnKey Linux.