Stable sweep time

Removed_REF_marker
erikkaashoek 5 years ago
parent 6847d5df4d
commit 84e2e43ae3

@ -3642,20 +3642,21 @@ static bool sweep(bool break_on_operation)
#ifdef __VBW__ #ifdef __VBW__
// ------------------------ do VBW processing ------------------------------ // ------------------------ do VBW processing ------------------------------
if (setting.frequency_step) {
int vbw_count_div2 = actual_rbw_x10 * 100 / setting.frequency_step / (setting.vbw_x10 == 0 ? 10 : setting.vbw_x10); int vbw_count_div2 = actual_rbw_x10 * 100 / setting.frequency_step / (setting.vbw_x10 == 0 ? 10 : setting.vbw_x10);
while(vbw_count_div2-- > 0){ while(vbw_count_div2-- > 0){
pureRSSI_t prev = temp_t[0]; pureRSSI_t prev = temp_t[0];
int j; int j;
// first point smooth // first point smooth
temp_t[0] = (prev + prev + temp_t[1])/3.0f; temp_t[0] = (prev + prev + temp_t[1])/3.0f;
for (j=1;j<sweep_points-1;j++){ for (j=1;j<sweep_points-1;j++){
pureRSSI_t old = temp_t[j]; // save current data point for next point smooth pureRSSI_t old = temp_t[j]; // save current data point for next point smooth
temp_t[j] = (prev + temp_t[j] + temp_t[j] + temp_t[j+1])/4; temp_t[j] = (prev + temp_t[j] + temp_t[j] + temp_t[j+1])/4;
prev = old; prev = old;
}
// last point smooth
temp_t[j] = (temp_t[j] + temp_t[j] + prev)/3;
} }
// last point smooth
temp_t[j] = (temp_t[j] + temp_t[j] + prev)/3;
} }
#endif #endif

@ -1919,6 +1919,7 @@ void si_fm_offset(int16_t offset)
extern deviceRSSI_t age[POINTS_COUNT]; extern deviceRSSI_t age[POINTS_COUNT];
static int buf_index = 0; static int buf_index = 0;
static bool buf_read = false; static bool buf_read = false;
uint32_t old_t = 0;
void SI446x_Fill(int s, int start) void SI446x_Fill(int s, int start)
{ {
@ -1930,6 +1931,10 @@ void SI446x_Fill(int s, int start)
#endif #endif
uint32_t t = setting.additional_step_delay_us; uint32_t t = setting.additional_step_delay_us;
if (t < old_t +100 && t + 100 > old_t) {
t = (t + old_t) >> 1;
}
old_t = t;
__disable_irq(); __disable_irq();
systime_t measure = chVTGetSystemTimeX(); systime_t measure = chVTGetSystemTimeX();

@ -3024,17 +3024,21 @@ redraw_cal_status:
plot_printf(buf, BLEN, "%.1FHz", actual_rbw_x10*100.0); plot_printf(buf, BLEN, "%.1FHz", actual_rbw_x10*100.0);
y = add_quick_menu(buf, x, y,(menuitem_t *)menu_rbw); y = add_quick_menu(buf, x, y,(menuitem_t *)menu_rbw);
#if 0 #ifdef __VBW__
// VBW // VBW
if (setting.frequency_step > 0) { if (setting.frequency_step > 0) {
ili9341_set_foreground(LCD_FG_COLOR); int vbw = setting.vbw_x10;
y += YSTEP + YSTEP/2 ; if (vbw != 0)
color = LCD_BRIGHT_COLOR_GREEN;
else {
color = LCD_FG_COLOR;
vbw = 10;
}
ili9341_set_foreground(color);
ili9341_drawstring("VBW:", x, y); ili9341_drawstring("VBW:", x, y);
y += YSTEP; y += YSTEP;
plot_printf(buf, BLEN, "%dkHz",(int)setting.vbw_x10/10.0); plot_printf(buf, BLEN, "%.1FHz", actual_rbw_x10*100.0 *vbw/10.0);
buf[6]=0; y = add_quick_menu(buf, x, y,(menuitem_t *)menu_vbw);
ili9341_drawstring(buf, x, y);
} }
#endif #endif
// Sweep time // Sweep time

Loading…
Cancel
Save

Powered by TurnKey Linux.