From 567532b1f899e9811fe5e76955c314e4d4a57b3e Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Wed, 8 Jul 2020 15:00:13 +0200 Subject: [PATCH] COnvert signal path loss to pure RSSI --- sa_core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sa_core.c b/sa_core.c index d027d96..0fdce04 100644 --- a/sa_core.c +++ b/sa_core.c @@ -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}; @@ -1370,10 +1370,10 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking) } if (MODE_INPUT(setting.mode)) { correct_RSSI = getSI4432_RSSI_correction() - + float_TO_PURE_RSSI( + - get_signal_path_loss() + + float_TO_PURE_RSSI( + get_level_offset() + get_attenuation() - - get_signal_path_loss() - setting.offset); } #if 0