@ -2513,6 +2513,7 @@ int test_output_switch = false;
inttest_output_drive=0;
inttest_output_drive=0;
inttest_output_attenuate=0;
inttest_output_attenuate=0;
intstart_temperature=0;
intstart_temperature=0;
boollevel_error=false;
#endif
#endif
pureRSSI_tperform(boolbreak_on_operation,inti,freq_tf,inttracking)// Measure the RSSI for one frequency, used from sweep and other measurement routines. Must do all HW setup
pureRSSI_tperform(boolbreak_on_operation,inti,freq_tf,inttracking)// Measure the RSSI for one frequency, used from sweep and other measurement routines. Must do all HW setup
@ -2629,7 +2630,13 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
correct_RSSI_freq=get_frequency_correction(f);
correct_RSSI_freq=get_frequency_correction(f);
a+=PURE_TO_float(correct_RSSI_freq);
a+=PURE_TO_float(correct_RSSI_freq);
#ifdef TINYSA4
#ifdef TINYSA4
a+=(Si446x_get_temp()-34.0)*0.0433;// Temperature correction
{
floatdt=Si446x_get_temp()-CENTER_TEMPERATURE;
if(dt>0)
a+=dt*DB_PER_DEGREE_ABOVE;// Temperature correction
else
a+=dt*DB_PER_DEGREE_BELOW;// Temperature correction
}
a+=3.0;// Always 3dB in attenuator
a+=3.0;// Always 3dB in attenuator
#endif
#endif
if(a!=old_a){
if(a!=old_a){
@ -2671,7 +2678,7 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
while(a-BELOW_MAX_DRIVE(d)>0&&d<MAX_DRIVE){// Increase if needed
while(a-BELOW_MAX_DRIVE(d)>0&&d<MAX_DRIVE){// Increase if needed
d++;
d++;
}
}
while(a-BELOW_MAX_DRIVE(d)<-31&&d>LOWEST_LEVEL){// reduce till it fits attenuator
while(a-BELOW_MAX_DRIVE(d)<-28&&d>LOWEST_LEVEL){// reduce till it fits attenuator (31 - 3)
d--;
d--;
}
}
a-=BELOW_MAX_DRIVE(d);
a-=BELOW_MAX_DRIVE(d);
@ -2685,8 +2692,18 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /