From 505559ee183b6360be1628afc48bd8a4601dd2f6 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Wed, 11 Nov 2026 08:58:25 +0100 Subject: [PATCH] Console: recall defaults (#179) recall defaults loads the factory settings in the low input mode, as PRESET > LOAD DEFAULTS, without storing them as the startup preset. --- main.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index e4f444e..580efe0 100644 --- a/main.c +++ b/main.c @@ -2176,17 +2176,24 @@ VNA_SHELL_FUNCTION(cmd_recall) if (argc != 1 || argv[0][0] == '?') goto usage; - int id = my_atoi(argv[0]); - if (id < 0 || id >= SAVEAREA_MAX) - goto usage; - // Check for success - if (caldata_recall(id) == -1) - shell_printf("Err, default load\r\n"); + if (get_str_index(argv[0], "defaults") == 0) { + reset_settings(M_LOW); // as PRESET > LOAD DEFAULTS, but the startup preset stays + set_refer_output(-1); + menu_move_top(); + ui_mode_normal(); + } else { + int id = my_atoi(argv[0]); + if (id < 0 || id >= SAVEAREA_MAX) + goto usage; + // Check for success + if (caldata_recall(id) == -1) + shell_printf("Err, default load\r\n"); + } update_frequencies(); redraw_request |= REDRAW_CAL_STATUS; return; usage: - shell_printf("recall {id}\r\n"); + shell_printf("recall {id}|defaults\r\n"); } VNA_SHELL_FUNCTION(cmd_channel)