setting.vbw_x10=3000;// trick to get right default rbw in zero span mode
}
}
freq_ttemp_actual_rbw_x10=setting.rbw_x10;// requested rbw , 32 bit !!!!!!
freq_ttemp_actual_rbw_x10=setting.rbw_x10;
if(temp_actual_rbw_x10==0){// if auto rbw
if(temp_actual_rbw_x10==0){// if auto rbw
if(setting.step_delay_mode==SD_FAST){// if in fast scanning
if(setting.step_delay_mode==SD_FAST){// if in fast scanning
#ifdef __SI4432__
#ifdef __SI4432__
if(setting.fast_speedup>2)
if(setting.fast_speedup>2)
temp_actual_rbw_x10=6*setting.vbw_x10;// rbw is six times the frequency step to ensure no gaps in coverage as there are some weird jumps
temp_actual_rbw_x10=6*frequency_step_x10;// rbw is six times the frequency step to ensure no gaps in coverage as there are some weird jumps
else
else
temp_actual_rbw_x10=4*setting.vbw_x10;// rbw is four times the frequency step to ensure no gaps in coverage as there are some weird jumps
temp_actual_rbw_x10=4*frequency_step_x10;// rbw is four times the frequency step to ensure no gaps in coverage as there are some weird jumps
#endif
#endif
#ifdef __SI4463__
#ifdef __SI4463__
temp_actual_rbw_x10=setting.vbw_x10;
temp_actual_rbw_x10=frequency_step_x10;
#endif
#endif
}else
}else{
#ifdef TINYSA4
temp_actual_rbw_x10=2*frequency_step_x10;// rbw is twice the frequency step to ensure no gaps in coverage
temp_actual_rbw_x10=2*setting.vbw_x10;// rbw is NOT twice the frequency step to ensure no gaps in coverage
}
#else
}
temp_actual_rbw_x10=2*setting.vbw_x10;// rbw is twice the frequency step to ensure no gaps in coverage
#endif
}
#ifdef __SI4432__
#ifdef __SI4432__
if(temp_actual_rbw_x10<26)
if(temp_actual_rbw_x10<26)
temp_actual_rbw_x10=26;
temp_actual_rbw_x10=26;
@ -2044,18 +2051,18 @@ void update_rbw(void) // calculate the actual_rbw and the vbwSteps (#
actual_rbw_x10=set_rbw(actual_rbw_x10);// see what rbw the SI4432 can realize
actual_rbw_x10=set_rbw(actual_rbw_x10);// see what rbw the SI4432 can realize
if(setting.frequency_step>0&&MODE_INPUT(setting.mode)){// When doing frequency scanning in input mode
if(setting.frequency_step>0&&MODE_INPUT(setting.mode)){// When doing frequency scanning in input mode
#ifdef TINYSA4
#ifdef TINYSA4
if(setting.vbw_x10 >actual_rbw_x10)
if(frequency_step_x10 >actual_rbw_x10)
vbwSteps=1+(setting.vbw_x10/actual_rbw_x10);//((int)(2 * (setting.vbw_x10 + (actual_rbw_x10/8)) / actual_rbw_x10)); // calculate # steps in between each frequency step due to rbw being less than frequency step
vbwSteps=1+(frequency_step_x10 /actual_rbw_x10);//((int)(2 * (frequency_step_x10 + (actual_rbw_x10/8)) / actual_rbw_x10)); // calculate # steps in between each frequency step due to rbw being less than frequency step
vbwSteps+=vbwSteps;
vbwSteps+=vbwSteps;
#else
#else
vbwSteps=((int)(2*(setting.vbw_x10 +(actual_rbw_x10/2))/actual_rbw_x10));// calculate # steps in between each frequency step due to rbw being less than frequency step
vbwSteps=((int)(2*(frequency_step_x10 +(actual_rbw_x10/2))/actual_rbw_x10));// calculate # steps in between each frequency step due to rbw being less than frequency step
#endif
#endif
if(setting.step_delay_mode==SD_PRECISE)// if in Precise scanning
if(setting.step_delay_mode==SD_PRECISE)// if in Precise scanning
vbwSteps*=2;// use twice as many steps
vbwSteps*=2;// use twice as many steps
if(vbwSteps<1)// at least one step, should never happen
if(vbwSteps<1)// at least one step, should never happen
vbwSteps=1;
vbwSteps=1;
}else{// in all other modes
}else{// in all other modes
setting.vbw_x10 =actual_rbw_x10;
frequency_step_x10 =actual_rbw_x10;
}
}
#ifdef TINYSA4
#ifdef TINYSA4
done:
done:
@ -2837,7 +2844,7 @@ modulation_again:
intoffs_div10=(t-(local_vbw_steps>>1))*100;// steps of x10 * settings.
intoffs_div10=(t-(local_vbw_steps>>1))*100;// steps of x10 * settings.
pureRSSI_trssi=perform(break_on_operation,i,frequencies[i],setting.tracking);// Measure RSSI for one of the frequencies
pureRSSI_trssi=perform(break_on_operation,i,frequencies[i],setting.tracking);// Measure RSSI for one of the frequencies
@ -3604,30 +3611,56 @@ sweep_again: // stay in sweep loop when output mo
}
}
}
}
}
}
if(
//if (MODE_INPUT(setting.mode))
{
#ifdef TINYSA4
#ifdef TINYSA4
if(show_bar&&(i&0x07)==0&&(setting.actual_sweep_time_us>ONE_SECOND_TIME||(chVTGetSystemTimeX()-start_of_sweep_timestamp)>ONE_SECOND_TIME/100)){// if required
show_bar&&(i&0x07)==0&&(setting.actual_sweep_time_us>ONE_SECOND_TIME||(chVTGetSystemTimeX()-start_of_sweep_timestamp)>ONE_SECOND_TIME/100)// if required
#else
#else
if(show_bar&&(i&0x07)==0&&setting.actual_sweep_time_us>ONE_SECOND_TIME){// if required
show_bar&&(i&0x07)==0&&setting.actual_sweep_time_us>ONE_SECOND_TIME// if required
#endif
#endif
intpos=i*(WIDTH+1)/sweep_points;
){
ili9341_set_background(LCD_SWEEP_LINE_COLOR);
intpos=i*(WIDTH+1)/sweep_points;
ili9341_fill(OFFSETX,CHART_BOTTOM+1,pos,1);// update sweep progress bar
ili9341_set_background(LCD_SWEEP_LINE_COLOR);
ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(OFFSETX,CHART_BOTTOM+1,pos,1);// update sweep progress bar