diff --git a/plot.c b/plot.c index 0544194..d7294d3 100644 --- a/plot.c +++ b/plot.c @@ -2188,7 +2188,24 @@ static void update_waterfall(void){ index_t *index = trace_index[TRACE_ACTUAL]; for (i=0; i< w_width; i++) { // Add new topline uint16_t y = CELL_Y(index[i]); - spi_buffer[i] = RGB565(255-y, y, (128-y)&0xFF); +#if 0 + spi_buffer[i] = RGB565(255-y, y, (128-y)&0xFF); +#else + uint16_t ratio = (HEIGHT_SCROLL - y)*2; +// ratio = (i*2); // Uncomment for testing the waterfall colors + int16_t b = 255 - ratio; + if (b > 255) b = 255; + if (b < 0) b = 0; + int16_t r = ratio - 255; + if (r > 255) r = 255; + if (r < 0) r = 0; + int16_t g = 255 - b - r; +#define gamma_correct(X) X = (X < 64 ? X * 2 : X < 128 ? 128 + (X-64) : X < 192 ? 192 + (X - 128)/2 : 225 + (X - 192) / 4) + gamma_correct(r); + gamma_correct(g); + gamma_correct(b); + spi_buffer[i] = RGB565(r, g, b); +#endif } ili9341_bulk(OFFSETX, HEIGHT_SCROLL+2, w_width, 1); } diff --git a/sa_cmd.c b/sa_cmd.c index 50a53e3..7a103d0 100644 --- a/sa_cmd.c +++ b/sa_cmd.c @@ -565,6 +565,7 @@ VNA_SHELL_FUNCTION(cmd_scanraw) int old_step = setting.frequency_step; float f_step = (stop-start)/ points; setting.frequency_step = (int32_t)f_step; + update_rbw(); streamPut(shell_stream, '{'); static uint32_t old_start=0, old_stop=0, old_points=0; if (old_start != start || old_stop != stop || old_points != points) {