From 923f336eedddbbf6ba59739f32cc295a9525058b Mon Sep 17 00:00:00 2001 From: DiSlord Date: Wed, 8 Jul 2020 21:24:45 +0300 Subject: [PATCH 1/3] Not use in vbwSteps mode slow operations (float, divide) It allow more fast sweep (less on 15ms) --- sa_core.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/sa_core.c b/sa_core.c index 4909937..0746391 100644 --- a/sa_core.c +++ b/sa_core.c @@ -1486,20 +1486,15 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking) pureRSSI_t RSSI = float_TO_PURE_RSSI(-150); int t = 0; do { - int offs = 0,sm; - uint32_t lf = (uint32_t)f; - if (vbwSteps > 1) { // Calculate sub steps + uint32_t lf = f; + if (vbwSteps > 1) { // Calculate sub steps + int offs_div10 = (t - (vbwSteps >> 1)) * 500 / 10; // steps of half the rbw + if ((vbwSteps & 1) == 0) // Uneven steps, center + offs_div10+= 250 / 10; // Even, shift half step + int offs = offs_div10 * actual_rbw_x10; if (setting.step_delay_mode == SD_PRECISE) - sm = 250; // steps of a quarter rbw - else - sm = 500; // steps of half the rbw - if (vbwSteps & 1) { // Uneven steps, center - offs = (t - (vbwSteps >> 1)) * sm; - } else { // Even, shift half step - offs = (t - (vbwSteps >> 1)) * sm + sm/2; - } - offs = (int)(offs * actual_rbw_x10/10.0); - lf = (uint32_t)(f + offs); + offs>>=1; // steps of a quarter rbw + lf += offs; } // --------------- Set all the LO's ------------------------ From 8f2bcc0d7353e142f784bc19a8905627f1c8c991 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Wed, 8 Jul 2020 23:13:43 +0300 Subject: [PATCH 2/3] Cleanup non cell area under button on exit --- ui.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui.c b/ui.c index 3f66690..d47d453 100644 --- a/ui.c +++ b/ui.c @@ -1771,6 +1771,9 @@ leave_ui_mode() // request_to_draw_cells_behind_numeric_input(); // erase_numeric_input(); // } + // Erase bottom area (not redraw on area update) + if (MENU_BUTTON_HEIGHT*MENU_BUTTON_MAX - area_height > 0) + ili9341_fill(LCD_WIDTH-MENU_BUTTON_WIDTH, area_height, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT*MENU_BUTTON_MAX - area_height, DEFAULT_BG_COLOR); redraw_request|=REDRAW_AREA | REDRAW_FREQUENCY | REDRAW_CAL_STATUS | REDRAW_BATTERY; } @@ -1927,10 +1930,9 @@ ui_mode_normal(void) { if (ui_mode == UI_NORMAL) return; - + leave_ui_mode(); area_width = AREA_WIDTH_NORMAL; area_height = AREA_HEIGHT_NORMAL; - leave_ui_mode(); ui_mode = UI_NORMAL; } From 76edcbf64bd919868c4a3166b00c93001454d872 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Wed, 8 Jul 2020 23:14:20 +0300 Subject: [PATCH 3/3] Remove not used variable Small simplify code --- plot.c | 5 +---- sa_core.c | 8 ++------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/plot.c b/plot.c index c5888e0..7239f09 100644 --- a/plot.c +++ b/plot.c @@ -30,8 +30,7 @@ #ifdef __SCROLL__ uint16_t _grid_y = NOSCROLL_GRIDY; -int waterfall = false; -int fullscreen = true; +static int waterfall = false; #endif static void cell_draw_marker_info(int x0, int y0); static void cell_grid_line_info(int x0, int y0); @@ -2290,7 +2289,6 @@ toggle_waterfall(void) _grid_y = SCROLL_GRIDY; ili9341_fill(OFFSETX, HEIGHT_SCROLL, LCD_WIDTH - OFFSETX, HEIGHT_NOSCROLL - HEIGHT_SCROLL, 0); waterfall = true; - fullscreen = false; w_min = (int)min_level; w_max = (int)peakLevel; if (w_max < w_min + 20) @@ -2299,7 +2297,6 @@ toggle_waterfall(void) } else { _grid_y = NOSCROLL_GRIDY; waterfall = false; - fullscreen = true; } request_to_redraw_grid(); } diff --git a/sa_core.c b/sa_core.c index 0746391..1e3c3d8 100644 --- a/sa_core.c +++ b/sa_core.c @@ -1508,12 +1508,8 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking) if (MODE_HIGH(setting.mode)) local_IF = 0; else { - if (setting.auto_IF) { - if (setting.spur) - local_IF = 433900000; - else - local_IF = 433800000; - } + if (setting.auto_IF) + local_IF = setting.spur ? 433900000 : 433800000; else local_IF = setting.frequency_IF; }