diff --git a/main.c b/main.c index 749f6c4..c7473ec 100644 --- a/main.c +++ b/main.c @@ -156,6 +156,8 @@ static THD_FUNCTION(Thread1, arg) shell_function(shell_nargs - 1, &shell_args[1]); shell_function = 0; osalThreadSleepMilliseconds(10); + if (dirty && MODE_OUTPUT(setting.mode)) + draw_menu(); // update screen if in output mode and dirty continue; } // Process UI inputs @@ -2298,8 +2300,9 @@ static const VNAShellCommand commands[] = { "if", cmd_if, 0 }, { "attenuate", cmd_attenuate, 0 }, { "level", cmd_level, 0 }, + { "sweeptime", cmd_sweeptime, 0 }, { "leveloffset", cmd_leveloffset, 0 }, - { "levelsweep", cmd_levelsweep, 0 }, + { "levelchange", cmd_levelchange, 0 }, { "modulation", cmd_modulation, 0 }, { "rbw", cmd_rbw, 0 }, { "mode", cmd_mode, 0 }, @@ -2428,6 +2431,10 @@ static void VNAShell_executeLine(char *line) } while (shell_function); } else { scp->sc_function(shell_nargs - 1, &shell_args[1]); + if (dirty && MODE_OUTPUT(setting.mode)) { + operation_requested = true; // ensure output is updated + draw_menu(); + } } return; } diff --git a/nanovna.h b/nanovna.h index a73d516..1fdcaee 100644 --- a/nanovna.h +++ b/nanovna.h @@ -743,6 +743,7 @@ void ui_mode_menu(void); void menu_push_lowoutput(void); void menu_push_highoutput(void); void menu_move_top(void); +void draw_menu(void); // Irq operation process set #define OP_NONE 0x00 diff --git a/sa_cmd.c b/sa_cmd.c index da1d8a8..3061f21 100644 --- a/sa_cmd.c +++ b/sa_cmd.c @@ -1,5 +1,4 @@ -/* All rights reserved. - * +/* * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) @@ -122,7 +121,7 @@ VNA_SHELL_FUNCTION(cmd_load) VNA_SHELL_FUNCTION(cmd_attenuate) { if (argc != 1) { - usage: +// usage: shell_printf("usage: attenuate 0..31|auto\r\n"); return; } @@ -146,12 +145,23 @@ VNA_SHELL_FUNCTION(cmd_level) set_level(f); } +VNA_SHELL_FUNCTION(cmd_sweeptime) +{ + if (argc != 1) { + shell_printf("usage: sweeptime 0.03..600\r\n"); + return; + } + float f = my_atof(argv[0]); + set_sweep_time(f*1000.0); +} + + -VNA_SHELL_FUNCTION(cmd_levelsweep) +VNA_SHELL_FUNCTION(cmd_levelchange) { if (argc != 1) { - shell_printf("usage: levelsweep -76..+76\r\n"); + shell_printf("usage: levelchange -70..+70\r\n"); return; } float f = my_atof(argv[0]); diff --git a/ui.c b/ui.c index b0bb6d7..431b8aa 100644 --- a/ui.c +++ b/ui.c @@ -123,7 +123,7 @@ void ui_mode_normal(void); //static void ui_mode_menu(void); static void ui_mode_numeric(int _keypad_mode); static void ui_mode_keypad(int _keypad_mode); -static void draw_menu(void); +// static void draw_menu(void); static void leave_ui_mode(void); static void erase_menu_buttons(void); static void ui_process_keypad(void); @@ -1721,7 +1721,7 @@ menu_apply_touch(void) ui_mode_normal(); } -static void +void draw_menu(void) { draw_menu_buttons(menu_stack[menu_current_level]);