@ -1515,56 +1515,64 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking) // M
else
signal_path_loss=+7;// Loss in dB (+ is gain)
#define T_LEVEL_UNDEF (1<<(16-2)) // should drop after 2 shifts left
#define T_LEVEL_BELOW 1
#define T_LEVEL_ABOVE 0
#define T_LEVEL_CLEAN ~(1<<2) // cleanup old trigger data
uint16_tdata_level=T_LEVEL_UNDEF;
intwait_for_trigger=false;
intold_SI4432_step_delay=SI4432_step_delay;
if(i==0&&setting.frequency_step==0&&setting.trigger!=T_AUTO){// if in zero span mode and wait for trigger to happen and NOT in trigger mode
wait_for_trigger=true;// signal the wait for trigger
SI4432_step_delay=0;
}
floatsubRSSI;
staticfloatcorrect_RSSI;// This is re-used between calls
if(i==0||setting.frequency_step!=0)// only cases where the value can change
correct_RSSI=get_level_offset()+get_attenuation()-signal_path_loss-setting.offset+get_frequency_correction(f);// calcuate the RSSI correction for later use
// Cache trigger search mode
registeruint16_tt_mode;
if(setting.trigger_direction==T_UP)
t_mode=(T_LEVEL_BELOW<<1)|T_LEVEL_ABOVE;// from bottom to up
else
t_mode=(T_LEVEL_ABOVE<<1)|T_LEVEL_BELOW;// from up to bottom
wait:
if(i==0&&t==0)// if first point in scan (here is get 1 point data)
correct_RSSI=get_level_offset()
+get_attenuation()
-signal_path_loss
-setting.offset
+get_frequency_correction(f)
+getSI4432_RSSI_correction();// calcuate the RSSI correction for later use
if(i==0&&t==0)// if first point in scan (here is get 1 point data)
start_of_sweep_timestamp=chVTGetSystemTimeX();// initialize start sweep time
int16_tpureRSSI;
// if ( i < 3)
// shell_printf("%d %.3f %.3f %.1f\r\n", i, local_IF/1000000.0, lf/1000000.0, subRSSI);
subRSSI=SI4432_RSSI(lf,MODE_SELECT(setting.mode))+correct_RSSI;// Get RSSI, either from pre-filled buffer or by reading SI4432 RSSI
// if ( i < 3)
// shell_printf("%d %.3f %.3f %.1f\r\n", i, local_IF/1000000.0, lf/1000000.0, subRSSI);
if(wait_for_trigger){// wait for trigger to happen
if((operation_requested||shell_function)&&break_on_operation)// allow aborting a wait for trigger
break;// abort
// ************** trigger mode if need
#define T_LEVEL_UNDEF (1<<(16-2)) // should drop after 2 shifts left
#define T_LEVEL_BELOW 1
#define T_LEVEL_ABOVE 0
#define T_LEVEL_CLEAN ~(1<<2) // cleanup old trigger data
// Store data level bitfield (remember only last 2 states)