diff --git a/main.c b/main.c index 8bee288..994912d 100644 --- a/main.c +++ b/main.c @@ -2403,7 +2403,7 @@ THD_FUNCTION(myshellThread, p) { (void)p; chRegSetThreadName("shell"); - shell_printf(VNA_SHELL_NEWLINE_STR"NanoVNA Shell"VNA_SHELL_NEWLINE_STR); + shell_printf(VNA_SHELL_NEWLINE_STR"tinySA Shell"VNA_SHELL_NEWLINE_STR); while (true) { shell_printf(VNA_SHELL_PROMPT_STR); if (VNAShell_readLine(shell_line, VNA_SHELL_MAX_LENGTH)) @@ -2666,7 +2666,7 @@ int main(void) myshellThread, NULL); chThdWait(shelltp); #else - shell_printf(VNA_SHELL_NEWLINE_STR"NanoVNA Shell"VNA_SHELL_NEWLINE_STR); + shell_printf(VNA_SHELL_NEWLINE_STR"tinySA Shell"VNA_SHELL_NEWLINE_STR); do { shell_printf(VNA_SHELL_PROMPT_STR); if (VNAShell_readLine(shell_line, VNA_SHELL_MAX_LENGTH)) diff --git a/sa_core.c b/sa_core.c index 71e401c..d6c60e1 100644 --- a/sa_core.c +++ b/sa_core.c @@ -212,16 +212,6 @@ int GetMode(void) #define POWER_OFFSET 15 #define SWITCH_ATTENUATION 30 -int get_attenuation(void) -{ - if (setting.mode == M_GENLOW) { - if (setting.step_atten) - return ( -(POWER_OFFSET + setting.attenuate - (setting.step_atten-1)*POWER_STEP + SWITCH_ATTENUATION)); - else - return ( -POWER_OFFSET - setting.attenuate + (setting.drive & 7) * 3); - } - return(setting.attenuate); -} void set_auto_attenuation(void) { @@ -234,6 +224,17 @@ void set_auto_reflevel(int v) setting.auto_reflevel = v; } +int get_attenuation(void) +{ + if (setting.mode == M_GENLOW) { + if (setting.step_atten) + return ( -(POWER_OFFSET + setting.attenuate - (setting.step_atten-1)*POWER_STEP + SWITCH_ATTENUATION)); + else + return ( -POWER_OFFSET - setting.attenuate + (setting.drive & 7) * 3); + } + return(setting.attenuate); +} + void set_attenuation(int a) { if (setting.mode == M_GENLOW) { @@ -262,6 +263,7 @@ void set_attenuation(int a) a = -a; } else { setting.step_atten = 0; + setting.auto_attenuation = false; } if (a<0) a = 0; @@ -269,7 +271,6 @@ void set_attenuation(int a) a=31; // if (setting.attenuate == a) // return; - setting.auto_attenuation = false; setting.attenuate = a; dirty = true; }