From 3a2d52b90ec025b26dbdfff4a9809592b01375cc Mon Sep 17 00:00:00 2001 From: DiSlord Date: Wed, 1 Jul 2020 13:55:09 +0300 Subject: [PATCH] Small fix setRBW parameter type --- nanovna.h | 5 ++--- sa_cmd.c | 6 +++--- sa_core.c | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/nanovna.h b/nanovna.h index be24a37..89ad6ec 100644 --- a/nanovna.h +++ b/nanovna.h @@ -186,7 +186,7 @@ void set_auto_reflevel(int); int is_paused(void); void set_actual_power(float); void SetGenerate(int); -void set_RBW(int); +void set_RBW(uint32_t rbw_x10); void set_drive(int d); void set_IF(int f); void set_step_delay(int t); @@ -571,7 +571,7 @@ typedef struct setting float attenuate; int auto_attenuation; int atten_step; - int rbw_x10; + uint32_t rbw_x10; int below_IF; int average; int show_stored; @@ -876,7 +876,6 @@ void reset_calibration(void); void set_reflevel(float); void set_offset(float); void set_unit(int); -void set_RBW(int); void set_switches(int); void set_trigger_level(float); void set_trigger(int); diff --git a/sa_cmd.c b/sa_cmd.c index d4c81b4..690f02e 100644 --- a/sa_cmd.c +++ b/sa_cmd.c @@ -203,11 +203,11 @@ VNA_SHELL_FUNCTION(cmd_rbw) shell_printf("usage: rbw 2..600|auto\r\n"); return; } - if (strcmp(argv[0],"auto") == 0 || strcmp(argv[0],"0") == 0) { + if (get_str_index(argv[0], "auto|0")>=0) { if (setting.rbw_x10 != 0) set_RBW(0); } else { - int a = my_atoi(argv[0]); + uint32_t a = my_atoui(argv[0]); if (a < 2 || a>600) goto usage; if (setting.rbw_x10 != a*10) @@ -491,7 +491,7 @@ VNA_SHELL_FUNCTION(cmd_w) (void)argc; int p = my_atoi(argv[0]); return; - set_RBW(p); + set_RBW(p*10); } VNA_SHELL_FUNCTION(cmd_f) diff --git a/sa_core.c b/sa_core.c index 09597ef..7e3f203 100644 --- a/sa_core.c +++ b/sa_core.c @@ -489,9 +489,9 @@ int level_is_calibrated(void) return(0); } -void set_RBW(int v) +void set_RBW(uint32_t rbw_x10) { - setting.rbw_x10 = v; + setting.rbw_x10 = rbw_x10; update_rbw(); dirty = true; }