diff --git a/sa_core.c b/sa_core.c index 6df6c94..f047e9a 100644 --- a/sa_core.c +++ b/sa_core.c @@ -3642,20 +3642,21 @@ static bool sweep(bool break_on_operation) #ifdef __VBW__ // ------------------------ do VBW processing ------------------------------ - - int vbw_count_div2 = actual_rbw_x10 * 100 / setting.frequency_step / (setting.vbw_x10 == 0 ? 10 : setting.vbw_x10); - while(vbw_count_div2-- > 0){ - pureRSSI_t prev = temp_t[0]; - int j; - // first point smooth - temp_t[0] = (prev + prev + temp_t[1])/3.0f; - for (j=1;j 0){ + pureRSSI_t prev = temp_t[0]; + int j; + // first point smooth + temp_t[0] = (prev + prev + temp_t[1])/3.0f; + for (j=1;j old_t) { + t = (t + old_t) >> 1; + } + old_t = t; __disable_irq(); systime_t measure = chVTGetSystemTimeX(); diff --git a/ui_sa.c b/ui_sa.c index ce06ca4..123aa86 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -3024,17 +3024,21 @@ redraw_cal_status: plot_printf(buf, BLEN, "%.1FHz", actual_rbw_x10*100.0); y = add_quick_menu(buf, x, y,(menuitem_t *)menu_rbw); -#if 0 +#ifdef __VBW__ // VBW if (setting.frequency_step > 0) { - ili9341_set_foreground(LCD_FG_COLOR); - y += YSTEP + YSTEP/2 ; + int vbw = setting.vbw_x10; + if (vbw != 0) + color = LCD_BRIGHT_COLOR_GREEN; + else { + color = LCD_FG_COLOR; + vbw = 10; + } + ili9341_set_foreground(color); ili9341_drawstring("VBW:", x, y); - y += YSTEP; - plot_printf(buf, BLEN, "%dkHz",(int)setting.vbw_x10/10.0); - buf[6]=0; - ili9341_drawstring(buf, x, y); + plot_printf(buf, BLEN, "%.1FHz", actual_rbw_x10*100.0 *vbw/10.0); + y = add_quick_menu(buf, x, y,(menuitem_t *)menu_vbw); } #endif // Sweep time