From bd30ca382301adee1b5cc405e8e804d2eca40470 Mon Sep 17 00:00:00 2001 From: Bohdan Kmit Date: Tue, 23 Apr 2024 12:53:18 +0300 Subject: [PATCH 1/3] Use right most column on the graphs and waterfall --- nanovna.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nanovna.h b/nanovna.h index abddc2a..c0acb0b 100644 --- a/nanovna.h +++ b/nanovna.h @@ -604,7 +604,7 @@ extern uint16_t graph_bottom; #define SD_CARD_START (LCD_HEIGHT-40-20) #define BATTERY_START (LCD_HEIGHT-40) -#define WIDTH (LCD_WIDTH - 1 - OFFSETX) +#define WIDTH (LCD_WIDTH - OFFSETX) #define HEIGHT (GRIDY*NGRIDY) #define FREQUENCIES_XPOS1 OFFSETX @@ -613,7 +613,7 @@ extern uint16_t graph_bottom; // #define CELLOFFSETX 0 -#define AREA_WIDTH_NORMAL (CELLOFFSETX + WIDTH + 1) +#define AREA_WIDTH_NORMAL (CELLOFFSETX + WIDTH) #define AREA_HEIGHT_NORMAL ( HEIGHT + 1) #define GRID_X_TEXT (AREA_WIDTH_NORMAL - 7*5) From 0608182a0f974b600f5513b14e0c7c759c258965 Mon Sep 17 00:00:00 2001 From: Bohdan Kmit Date: Tue, 23 Apr 2024 12:55:00 +0300 Subject: [PATCH 2/3] Draw line between graphs and waterfall --- nanovna.h | 2 +- plot.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nanovna.h b/nanovna.h index c0acb0b..298426d 100644 --- a/nanovna.h +++ b/nanovna.h @@ -614,7 +614,7 @@ extern uint16_t graph_bottom; // #define CELLOFFSETX 0 #define AREA_WIDTH_NORMAL (CELLOFFSETX + WIDTH) -#define AREA_HEIGHT_NORMAL ( HEIGHT + 1) +#define AREA_HEIGHT_NORMAL ( HEIGHT) #define GRID_X_TEXT (AREA_WIDTH_NORMAL - 7*5) diff --git a/plot.c b/plot.c index 09d659f..135d8d7 100644 --- a/plot.c +++ b/plot.c @@ -2117,7 +2117,7 @@ static void update_waterfall(void){ int i; int w_width = area_width < WIDTH ? area_width : WIDTH; // START_PROFILE; - for (i = CHART_BOTTOM-1; i >=graph_bottom+1; i--) { // Scroll down + for (i = CHART_BOTTOM-1; i >=graph_bottom; i--) { // Scroll down ili9341_read_memory(OFFSETX, i, w_width, 1, spi_buffer); ili9341_bulk(OFFSETX, i+1, w_width, 1); } @@ -2188,7 +2188,7 @@ static void update_waterfall(void){ spi_buffer[j++] = color; } } - ili9341_bulk(OFFSETX, graph_bottom+1, w_width, 1); + ili9341_bulk(OFFSETX, graph_bottom, w_width, 1); // STOP_PROFILE; } #if 0 From 352e8437a30d272b50b2d39e81c9aac4ad573e85 Mon Sep 17 00:00:00 2001 From: Bohdan Kmit Date: Tue, 23 Apr 2024 13:11:25 +0300 Subject: [PATCH 3/3] Speed up waterfall drawing by scrolling more than one line at once --- plot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plot.c b/plot.c index 135d8d7..7145244 100644 --- a/plot.c +++ b/plot.c @@ -2117,7 +2117,12 @@ static void update_waterfall(void){ int i; int w_width = area_width < WIDTH ? area_width : WIDTH; // START_PROFILE; - for (i = CHART_BOTTOM-1; i >=graph_bottom; i--) { // Scroll down +#define WATERFALL_MULTI (SPI_BUFFER_SIZE / WIDTH) + for (i = CHART_BOTTOM-WATERFALL_MULTI; i>=graph_bottom; i-=WATERFALL_MULTI) { // Scroll down WATERFALL_MULTI lines at once + ili9341_read_memory(OFFSETX, i, w_width, WATERFALL_MULTI, spi_buffer); + ili9341_bulk(OFFSETX, i+1, w_width, WATERFALL_MULTI); + } + for (i = CHART_BOTTOM-((CHART_BOTTOM-graph_bottom)/WATERFALL_MULTI)*WATERFALL_MULTI-1; i>=graph_bottom; i--) { // Scroll down remaining lines ili9341_read_memory(OFFSETX, i, w_width, 1, spi_buffer); ili9341_bulk(OFFSETX, i+1, w_width, 1); }