Small fix setRBW parameter type

pull/4/head
DiSlord 6 years ago
parent 0dedf0b19d
commit 3a2d52b90e

@ -186,7 +186,7 @@ void set_auto_reflevel(int);
int is_paused(void); int is_paused(void);
void set_actual_power(float); void set_actual_power(float);
void SetGenerate(int); void SetGenerate(int);
void set_RBW(int); void set_RBW(uint32_t rbw_x10);
void set_drive(int d); void set_drive(int d);
void set_IF(int f); void set_IF(int f);
void set_step_delay(int t); void set_step_delay(int t);
@ -571,7 +571,7 @@ typedef struct setting
float attenuate; float attenuate;
int auto_attenuation; int auto_attenuation;
int atten_step; int atten_step;
int rbw_x10; uint32_t rbw_x10;
int below_IF; int below_IF;
int average; int average;
int show_stored; int show_stored;
@ -876,7 +876,6 @@ void reset_calibration(void);
void set_reflevel(float); void set_reflevel(float);
void set_offset(float); void set_offset(float);
void set_unit(int); void set_unit(int);
void set_RBW(int);
void set_switches(int); void set_switches(int);
void set_trigger_level(float); void set_trigger_level(float);
void set_trigger(int); void set_trigger(int);

@ -203,11 +203,11 @@ VNA_SHELL_FUNCTION(cmd_rbw)
shell_printf("usage: rbw 2..600|auto\r\n"); shell_printf("usage: rbw 2..600|auto\r\n");
return; 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) if (setting.rbw_x10 != 0)
set_RBW(0); set_RBW(0);
} else { } else {
int a = my_atoi(argv[0]); uint32_t a = my_atoui(argv[0]);
if (a < 2 || a>600) if (a < 2 || a>600)
goto usage; goto usage;
if (setting.rbw_x10 != a*10) if (setting.rbw_x10 != a*10)
@ -491,7 +491,7 @@ VNA_SHELL_FUNCTION(cmd_w)
(void)argc; (void)argc;
int p = my_atoi(argv[0]); int p = my_atoi(argv[0]);
return; return;
set_RBW(p); set_RBW(p*10);
} }
VNA_SHELL_FUNCTION(cmd_f) VNA_SHELL_FUNCTION(cmd_f)

@ -489,9 +489,9 @@ int level_is_calibrated(void)
return(0); 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(); update_rbw();
dirty = true; dirty = true;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.