From 3fc17e18f900c6bb31fb1e72bab345adf576c15c Mon Sep 17 00:00:00 2001 From: TT Date: Mon, 7 Oct 2019 22:24:32 +0900 Subject: [PATCH] fix: break sweep loop on frequency change --- main.c | 2 ++ nanovna.h | 3 +++ ui.c | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index acd7c1a6..7a933b3e 100644 --- a/main.c +++ b/main.c @@ -793,6 +793,8 @@ update_frequencies(void) } set_frequencies(start, stop, sweep_points); + operation_requested = OP_FREQCHANGE; + update_marker_index(); // set grid layout diff --git a/nanovna.h b/nanovna.h index 809921e1..7f355000 100644 --- a/nanovna.h +++ b/nanovna.h @@ -86,6 +86,9 @@ extern int8_t sweep_enabled; extern void ui_init(void); extern void ui_process(void); +enum { OP_NONE = 0, OP_LEVER, OP_TOUCH, OP_FREQCHANGE }; +extern uint8_t operation_requested; + /* * dsp.c */ diff --git a/ui.c b/ui.c index 80147b9c..3cbac63f 100644 --- a/ui.c +++ b/ui.c @@ -59,7 +59,6 @@ static uint32_t last_button_down_ticks; static uint32_t last_button_repeat_ticks; static int8_t inhibit_until_release = FALSE; -enum { OP_NONE = 0, OP_LEVER, OP_TOUCH }; uint8_t operation_requested = OP_NONE; int8_t previous_marker = -1;