if(setting.step_delay_mode==SD_PRECISE)// In precise mode wait twice as long for RSSI to stabalize
if(setting.step_delay_mode==SD_PRECISE)// In precise mode wait twice as long for RSSI to stabalize
SI4432_step_delay*=2;
SI4432_step_delay*=2;
@ -1251,6 +1245,9 @@ void update_rbw(void) // calculate the actual_rbw and the vbwSteps (#
#ifdef __SI4432__
#ifdef __SI4432__
SI4432_Sel=MODE_SELECT(setting.mode);
SI4432_Sel=MODE_SELECT(setting.mode);
actual_rbw_x10=SI4432_SET_RBW(actual_rbw_x10);// see what rbw the SI4432 can realize
actual_rbw_x10=SI4432_SET_RBW(actual_rbw_x10);// see what rbw the SI4432 can realize
#endif
#ifdef __SI4463__
actual_rbw_x10=SI4463_SET_RBW(actual_rbw_x10);// see what rbw the SI4432 can realize
#endif
#endif
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
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*(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
@ -1707,6 +1704,7 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking)
set_freq(SI4432_LO,local_IF+lf);// otherwise to above IF
set_freq(SI4432_LO,local_IF+lf);// otherwise to above IF
#endif
#endif
#ifdef __ADF4351__
#ifdef __ADF4351__
// START_PROFILE;
if(setting.mode==M_LOW){
if(setting.mode==M_LOW){
if(!setting.tracking&&S_STATE(setting.below_IF)){// if in low input mode and below IF
if(!setting.tracking&&S_STATE(setting.below_IF)){// if in low input mode and below IF
if(lf>local_IF)
if(lf>local_IF)
@ -1718,6 +1716,7 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking)
}elseif(setting.mode==M_HIGH){
}elseif(setting.mode==M_HIGH){
set_freq(SI4463_RX,local_IF+lf);// sweep RX
set_freq(SI4463_RX,local_IF+lf);// sweep RX
}
}
// STOP_PROFILE;
#endif
#endif
#endif
#endif
}
}
@ -3252,7 +3251,13 @@ void self_test(int test)
inti=15;// calibrate low mode power on 30 MHz;
inti=15;// calibrate low mode power on 30 MHz;
test_prepare(i);
test_prepare(i);
setting.step_delay=8000;
setting.step_delay=8000;
for(intj=0;j<57;j++){
#ifdef __SI4432__
#define RBW_COUNT 57
#endif
#ifdef __SI4463__
#define RBW_COUNT 7
#endif
for(intj=0;j<RBW_COUNT;j++){
if(setting.test_argument!=0)
if(setting.test_argument!=0)
j=setting.test_argument;
j=setting.test_argument;
// do_again:
// do_again:
@ -3269,6 +3274,9 @@ void self_test(int test)
setting.offset_delay=setting.step_delay/2;
setting.offset_delay=setting.step_delay/2;
#ifdef __SI4432__
#ifdef __SI4432__
setting.rbw_x10=SI4432_force_RBW(j);
setting.rbw_x10=SI4432_force_RBW(j);
#endif
#ifdef __SI4463__
setting.rbw_x10=SI4463_force_RBW(j);
#endif
#endif
shell_printf("RBW = %f, ",setting.rbw_x10/10.0);
shell_printf("RBW = %f, ",setting.rbw_x10/10.0);
#if 0
#if 0
@ -3315,7 +3323,7 @@ void self_test(int test)
#endif
#endif
setting.offset_delay=1600;
setting.offset_delay=1600;
#if 1 // Enable for offset tuning stepping
#if 0// Enable for offset tuning stepping
test_value=saved_peakLevel;
test_value=saved_peakLevel;
if((uint32_t)(setting.rbw_x10*1000)/(sweep_points)<8000){// fast mode possible
if((uint32_t)(setting.rbw_x10*1000)/(sweep_points)<8000){// fast mode possible