@ -172,14 +172,14 @@ uint32_t calc_min_sweep_time_us(void) // Estimate minimum sweep time in
if(MODE_OUTPUT(setting.mode))
if(MODE_OUTPUT(setting.mode))
t=100;
t=100;
else{
else{
uint32_tbare_sweep_time=(SI4432_step_delay+MEASURE_TIME)*(sweep_points-1);// Single RSSI delay and measurement time in uS while scanning
uint32_tbare_sweep_time=(SI4432_step_delay+MEASURE_TIME)*(sweep_points);// Single RSSI delay and measurement time in uS while scanning
if(FREQ_IS_CW()){
if(FREQ_IS_CW()){
bare_sweep_time=MINIMUM_SWEEP_TIME;// minimum sweep time in fast CW mode
bare_sweep_time=MINIMUM_SWEEP_TIME;// minimum sweep time in fast CW mode
if(setting.repeat!=1||setting.sweep_time_us>=ONE_SECOND_TIME ||setting.spur!=0)// if no fast CW sweep possible
if(setting.repeat!=1||setting.sweep_time_us>=100*ONE_MS_TIME ||setting.spur!=0)// if no fast CW sweep possible
bare_sweep_time=15000;// minimum CW sweep time when not in fast CW mode
bare_sweep_time=15000;// minimum CW sweep time when not in fast CW mode
}
}
t=vbwSteps*(setting.spur?2:1)*bare_sweep_time;// factor in vbwSteps and spur impact
t=vbwSteps*(setting.spur?2:1)*bare_sweep_time;// factor in vbwSteps and spur impact
t+=(setting.repeat-1)*REPEAT_TIME*(sweep_points-1);// Add time required for repeats
t+=(setting.repeat-1)*REPEAT_TIME*(sweep_points);// Add time required for repeats
}
}
returnt;
returnt;
}
}
@ -1285,7 +1285,7 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking) // M
dirty=false;
dirty=false;
if(setting.spur)// if in spur avoidance mode
if(setting.spur)// if in spur avoidance mode
setting.spur=1;// resync spur in case of previous abort
setting.spur=1;// resync spur in case of previous abort
start_of_sweep_timestamp = chVTGetSystemTimeX();// initialize again to eliminate time spend in apply_settings
// start_of_sweep_timestamp = chVTGetSystemTimeX(); // initialize again to eliminate time spend in apply_settings
}
}
if(setting.mode==M_GENLOW&&setting.level_sweep!=0.0){// if in low output mode and level sweep is active
if(setting.mode==M_GENLOW&&setting.level_sweep!=0.0){// if in low output mode and level sweep is active
@ -1526,6 +1526,9 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking) // M
correct_RSSI=get_level_offset()+get_attenuation()-signal_path_loss-setting.offset+get_frequency_correction(f);// calcuate the RSSI correction for later use
correct_RSSI=get_level_offset()+get_attenuation()-signal_path_loss-setting.offset+get_frequency_correction(f);// calcuate the RSSI correction for later use
wait:
wait:
if(i==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
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)
// if ( i < 3)
// shell_printf("%d %.3f %.3f %.1f\r\n", i, local_IF/1000000.0, lf/1000000.0, subRSSI);
// shell_printf("%d %.3f %.3f %.1f\r\n", i, local_IF/1000000.0, lf/1000000.0, subRSSI);
@ -1535,7 +1538,7 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking) // M
break;// abort
break;// abort
if(subRSSI<setting.trigger_level)// trigger level not yet reached
if(subRSSI<setting.trigger_level)// trigger level not yet reached
gotowait;// get next rssi
gotowait;// get next rssi
start_of_sweep_timestamp = chVTGetSystemTimeX(); // Actually one sample to late
// start_of_sweep_timestamp = chVTGetSystemTimeX(); // Actually one sample to late