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:
SI4432_step_delay=0;
}
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
subRSSI=SI4432_RSSI(lf,MODE_SELECT(setting.mode))+correct_RSSI;// Get RSSI, either from pre-filled buffer or by reading SI4432 RSSI
int16_tpureRSSI;
// 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
pureRSSI=SI4432_Read_Byte(SI4432_REG_RSSI)<<4;
if(break_on_operation&&operation_requested)// allow aborting a wait for trigger
break;// abort
// Store data level bitfield (remember only last 2 states)