Update RBW from scanwar

pull/4/head
erikkaashoek 6 years ago
parent 58cea9e6d2
commit cf27d943ab

@ -2188,7 +2188,24 @@ static void update_waterfall(void){
index_t *index = trace_index[TRACE_ACTUAL]; index_t *index = trace_index[TRACE_ACTUAL];
for (i=0; i< w_width; i++) { // Add new topline for (i=0; i< w_width; i++) { // Add new topline
uint16_t y = CELL_Y(index[i]); uint16_t y = CELL_Y(index[i]);
#if 0
spi_buffer[i] = RGB565(255-y, y, (128-y)&0xFF); 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); ili9341_bulk(OFFSETX, HEIGHT_SCROLL+2, w_width, 1);
} }

@ -565,6 +565,7 @@ VNA_SHELL_FUNCTION(cmd_scanraw)
int old_step = setting.frequency_step; int old_step = setting.frequency_step;
float f_step = (stop-start)/ points; float f_step = (stop-start)/ points;
setting.frequency_step = (int32_t)f_step; setting.frequency_step = (int32_t)f_step;
update_rbw();
streamPut(shell_stream, '{'); streamPut(shell_stream, '{');
static uint32_t old_start=0, old_stop=0, old_points=0; static uint32_t old_start=0, old_stop=0, old_points=0;
if (old_start != start || old_stop != stop || old_points != points) { if (old_start != start || old_stop != stop || old_points != points) {

Loading…
Cancel
Save

Powered by TurnKey Linux.