From e6d680cd44337e36982e068f4167a3d04df6cae7 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Wed, 1 Apr 2020 00:36:43 +0300 Subject: [PATCH] Not wait sweep end for apply bandwidth command More size screen/font definitions Prevent overflow on bigger POINTS_COUNT values --- main.c | 6 +++--- ui.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index aa5a51e..d070b36 100644 --- a/main.c +++ b/main.c @@ -91,7 +91,7 @@ int8_t sweep_mode = SWEEP_ENABLE; volatile uint8_t redraw_request = 0; // contains REDRAW_XXX flags // sweep operation variables -volatile uint8_t wait_count = 0; +volatile uint16_t wait_count = 0; static uint16_t p_sweep = 0; // ChibiOS i2s buffer must be 2x size (for process one while next buffer filled by DMA) @@ -209,7 +209,7 @@ transform_domain(void) // and calculate ifft for time domain float* tmp = (float*)spi_buffer; - uint8_t window_size = POINTS_COUNT, offset = 0; + uint16_t window_size = POINTS_COUNT, offset = 0; uint8_t is_lowpass = FALSE; switch (domain_mode & TD_FUNC) { case TD_FUNC_BANDPASS: @@ -2147,7 +2147,7 @@ static const VNAShellCommand commands[] = {"reset" , cmd_reset , 0}, {"freq" , cmd_freq , CMD_WAIT_MUTEX}, {"offset" , cmd_offset , CMD_WAIT_MUTEX}, - {"bandwidth" , cmd_bandwidth , CMD_WAIT_MUTEX}, + {"bandwidth" , cmd_bandwidth , 0}, #ifdef ENABLE_TIME_COMMAND {"time" , cmd_time , 0}, #endif diff --git a/ui.c b/ui.c index 9c9668a..c1ba59a 100644 --- a/ui.c +++ b/ui.c @@ -1283,7 +1283,7 @@ draw_numeric_input(const char *buf) int focused = FALSE; uint16_t xsim = 0b0010010000000000; - for (i = 0, x = 64; i < 10 && buf[i]; i++, xsim<<=1) { + for (i = 0, x = 10 + 10 * FONT_WIDTH + 4; i < 10 && buf[i]; i++, xsim<<=1) { uint16_t fg = DEFAULT_MENU_TEXT_COLOR; uint16_t bg = config.menu_normal_color; int c = buf[i];