From 932a5808fbc4662625dec195c791fa54b71a890d Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Mon, 5 Jul 2021 11:38:21 +0200 Subject: [PATCH] Limit lines and console commands updated --- main.c | 89 ++++++++++++++++++++++++++++------------------- nanovna.h | 9 +++-- sa_core.c | 39 ++++++++++++++------- ui_sa.c | 102 ++++++++++++++++++------------------------------------ 4 files changed, 117 insertions(+), 122 deletions(-) diff --git a/main.c b/main.c index a6fec2b..655ed1e 100644 --- a/main.c +++ b/main.c @@ -1363,28 +1363,33 @@ void set_trace_refpos(float refpos) VNA_SHELL_FUNCTION(cmd_trace) { - int t; + int t = 0; + bool do_one = false; if (argc == 0) { for (t = 0; t < TRACES_MAX; t++) { +show_one: if (IS_TRACE_ENABLE(t)) { const char *type = unit_string[setting.unit]; // get_trace_typename(t); - const char *channel = trc_channel_name[t]; +// const char *channel = trc_channel_name[t]; float scale = get_trace_scale(); float refpos = get_trace_refpos(); - shell_printf("%d %s %s %f %f\r\n", t, type, channel, scale, refpos); + shell_printf("%d: %s %f %f \r\n", t+1, type, refpos, scale, (setting.stored[t]?", frozen":"")); } + if (do_one) break; } return; } - + int next_arg = 0; if ('0' <= argv[0][0] && argv[0][0] <= '9') { - t = my_atoi(argv[0]); - if (argc != 1 || t < 0 || t >= TRACES_MAX) + t = my_atoi(argv[0]) - 1; + next_arg++; + argc--; + if (t < 0 || t >= TRACES_MAX) goto usage; - const char *type = "LOGMAG";//unit_string[setting.unit]; - const char *channel = trc_channel_name[t]; - shell_printf("%d %s %s\r\n", t, type, channel); - return; + if (argc >= 1) + goto process; + do_one = true; + goto show_one; } #if MAX_UNIT_TYPE != 4 #error "Unit type enum possibly changed, check cmd_trace function" @@ -1398,23 +1403,15 @@ VNA_SHELL_FUNCTION(cmd_trace) } // goto usage; } - static const char cmd_store_list[] = "store|clear|subtract|value"; + static const char cmd_store_list[] = "value"; + process: if (argc == 1) { - int type = get_str_index(argv[0], cmd_store_list); + int type = get_str_index(argv[next_arg], cmd_store_list); if (type >= 0) { switch(type) { case 0: - store_trace(0,2); - goto update; - case 1: - set_clear_storage(); - goto update; - case 2: - set_subtract_storage(); - goto update; - case 3: for (int i=0;i= 2) { + switch (get_str_index(argv[next_arg++], cmd_load_list)) { case 0: + store_trace(t, my_atoi(argv[next_arg++])); + goto update; + case 1: + setting.stored[t]= true;; + goto update; + case 2: + subtract_trace(t,my_atoi(argv[next_arg++])); + goto update; + case 4: { - int i = my_atoi(argv[1]); + int i = my_atoi(argv[next_arg++]); if (i>= sweep_points) goto usage; - float v = my_atof(argv[2]); - stored_t[i] = v; + float v = my_atof(argv[next_arg]); + measured[t][i] = v; goto update; } } @@ -1461,14 +1466,14 @@ update: redraw_request |= REDRAW_CAL_STATUS; return; usage: - shell_printf("trace {%s}\r\n"\ + shell_printf("trace {trace} {%s}\r\n"\ "trace {%s}\r\n"\ "trace {%s} {value|auto}\r\n", cmd_store_list, cmd_type_list, cmd_scale_ref_list); } VNA_SHELL_FUNCTION(cmd_marker) { - int t; + int t,tr; if (argc == 0) { for (t = 0; t < MARKERS_MAX; t++) { if (markers[t].enabled) { @@ -1496,7 +1501,7 @@ VNA_SHELL_FUNCTION(cmd_marker) return; } #ifdef TINYSA4 - static const char cmd_marker_list[] = "on|off|peak|delta|noise|tracking|stored|trace_aver"; + static const char cmd_marker_list[] = "on|off|peak|delta|noise|tracking|trace|trace_aver"; static const char cmd_marker_on_off[] = "off|on"; int marker_mask = 0; #else @@ -1526,8 +1531,15 @@ VNA_SHELL_FUNCTION(cmd_marker) #ifdef TINYSA4 // M_NORMAL=0,M_REFERENCE=1, M_DELTA=2, M_NOISE=4, M_STORED=8, M_AVER=16, M_TRACKING=32, M_DELETE=64 // Tracking must be last. case 3: - marker_mask = M_DELTA; - goto set_mask; + tr=0; + if (argc == 3 &&( argv[2][0] < '0' || argv[2][0] > '9' )) { + tr = my_atoui(argv[2]); + markers[t].mtype |= M_DELTA; + markers[t].ref= tr; + } else if (get_str_index(argv[2],cmd_marker_on_off) == 0) { + markers[t].mtype &= ~M_DELTA; + } + return; case 4: marker_mask = M_NOISE; goto set_mask; @@ -1535,8 +1547,12 @@ VNA_SHELL_FUNCTION(cmd_marker) marker_mask = M_TRACKING; goto set_mask; case 6: - marker_mask = M_STORED; - goto set_mask; + tr=2; + if (argc == 3 &&( argv[2][0] < '0' || argv[2][0] > '9' )) { + tr = my_atoui(argv[2]); + } + markers[t].trace= tr; + return; case 7: marker_mask = M_AVER; set_mask: @@ -1547,6 +1563,7 @@ VNA_SHELL_FUNCTION(cmd_marker) case 1: markers[t].mtype |= marker_mask; return; } } + return; #endif } usage: diff --git a/nanovna.h b/nanovna.h index 0f57fc4..24d9108 100644 --- a/nanovna.h +++ b/nanovna.h @@ -76,7 +76,6 @@ #define __CHANNEL_POWER__ #define __LIMITS__ #define __MCU_CLOCK_SHIFT__ -#define __TRACE_MENU__ #ifdef TINYSA4 #define __USE_RTC__ // Enable RTC clock #define __USE_SD_CARD__ // Enable SD card support @@ -96,8 +95,8 @@ //#define __FFT_DECONV__ #else //#define __HARMONIC__ -#endif #define __USE_FREQ_TABLE__ // Enable use table for frequency list +#endif #ifdef TINYSA3 #define VARIANT(X,Y) (X) @@ -134,7 +133,7 @@ #endif #ifdef TINYSA4 #define MARKER_COUNT 8 -#define TRACES_MAX 3 +#define TRACES_MAX 4 #else #define MARKER_COUNT 4 #define TRACES_MAX 3 @@ -867,8 +866,8 @@ typedef uint16_t pixel_t; [LCD_MENU_TEXT_COLOR ] = RGB565( 0, 0, 0), \ [LCD_MENU_ACTIVE_COLOR] = RGB565(210,210,210), \ [LCD_TRACE_1_COLOR ] = RGB565(255,255, 0), \ -[LCD_TRACE_2_COLOR ] = RGB565(255, 0, 0), \ -[LCD_TRACE_3_COLOR ] = RGB565( 0,255, 0), \ +[LCD_TRACE_2_COLOR ] = RGB565(255, 64, 64), \ +[LCD_TRACE_3_COLOR ] = RGB565( 64,255, 64), \ [LCD_TRACE_4_COLOR ] = RGB565(255, 0,255), \ [LCD_NORMAL_BAT_COLOR ] = RGB565( 31,227, 0), \ [LCD_LOW_BAT_COLOR ] = RGB565(255, 0, 0), \ diff --git a/sa_core.c b/sa_core.c index 75efd3f..533a43e 100644 --- a/sa_core.c +++ b/sa_core.c @@ -242,6 +242,8 @@ void reset_settings(int m) setting.stored[t] = false; setting.subtract[t] = 0; // Disabled } + setting.stored[TRACE_STORED] = true; + TRACE_DISABLE(TRACE_STORED_FLAG|TRACE_TEMP_FLAG); #ifdef TINYSA4 setting.harmonic = 3; // Automatically used when above ULTRA_MAX_FREQ #else @@ -290,7 +292,6 @@ void reset_settings(int m) setting.fast_speedup = 0; setting.trigger_level = -150.0; setting.linearity_step = 0; - TRACE_DISABLE(TRACE_STORED_FLAG|TRACE_TEMP_FLAG); // setting.refer = -1; // do not reset reffer when switching modes setting.mute = true; #ifdef __SPUR__ @@ -489,6 +490,7 @@ static setting_t saved_setting; void set_measurement(int m) { #ifdef __LINEARITY__ + setting.stored[TRACE_STORED] = true; if (m == M_LINEARITY) { for (int j = 0; j < setting._sweep_points; j++) stored_t[j] = -150; @@ -915,8 +917,15 @@ void limits_update(void) { if (setting.limits[i].enabled) { active = true; - while (j < sweep_points && (getFrequency(j) < setting.limits[i].frequency || setting.limits[i].frequency == 0)) - stored_t[j++] = setting.limits[i].level; + while (j < sweep_points && (getFrequency(j) < setting.limits[i].frequency || setting.limits[i].frequency == 0)) { + if (i == 0) + stored_t[j] = setting.limits[i].level; + else + stored_t[j] = setting.limits[i-1].level + + (getFrequency(j) - setting.limits[i-1].frequency) * (setting.limits[i].level - setting.limits[i-1].level) / + (setting.limits[i].frequency-setting.limits[i-1].frequency); + j++; + } } } if (active) @@ -973,7 +982,7 @@ void subtract_trace(int t, int f) if (t == f) return; if (!setting.subtract[t]) { - setting.subtract[t] = f; + setting.subtract[t] = f+1; setting.normalize_level = 0.0; setting.auto_attenuation = false; // Otherwise noise level may move leading to strange measurements } else @@ -1173,7 +1182,7 @@ void set_average(int t, int v) #endif ); #ifndef __TRACES_MENU__ - if (enable) { + if (enable && !IS_TRACES_ENABLED(TRACE_TEMP_FLAG)) { enableTracesAtComplete(TRACE_TEMP_FLAG); scan_after_dirty = 0; } else @@ -2697,6 +2706,7 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) / clear_frequency_cache(); #endif calculate_correction(); // pre-calculate correction factor dividers to avoid float division + limits_update(); apply_settings(); old_a = -150; // clear cached level setting // Initialize HW @@ -4676,6 +4686,7 @@ static volatile int dummy; if (setting.measurement == M_LINEARITY && setting.linearity_step < sweep_points) { setting.attenuate_x2 = (29.0 - setting.linearity_step * 30.0 / (sweep_points))*2.0; dirty = true; + setting.stored[TRACE_STORED]=true; stored_t[setting.linearity_step] = peakLevel; setting.linearity_step++; } @@ -4910,8 +4921,8 @@ const test_case_t test_case [] = TEST_CASE_STRUCT(TC_FLAT, TP_10MHZEXTRA, 30, 14, -18, 9, -60), // 8 BPF pass band flatness TEST_CASE_STRUCT(TC_BELOW, TP_30MHZ, 900, 1, -90, 0, -90), // 9 LPF cutoff TEST_CASE_STRUCT(TC_SIGNAL, TP_30MHZ_SWITCH,30, 7, -23, 10, -50), // 10 Switch isolation using high attenuation - TEST_CASE_STRUCT(TC_DISPLAY, TP_30MHZ, 30, 0, -25, 145, -60), // 11 test display - TEST_CASE_STRUCT(TC_ATTEN, TP_30MHZ, 30, 0, CAL_LEVEL, 145, -60), // 12 Measure atten step accuracy + TEST_CASE_STRUCT(TC_DISPLAY, TP_30MHZ, 30, 0, -25, 50, -60), // 11 test display + TEST_CASE_STRUCT(TC_ATTEN, TP_30MHZ, 30, 0, CAL_LEVEL, 50, -60), // 12 Measure atten step accuracy TEST_CASE_STRUCT(TC_SIGNAL, TP_30MHZ_LNA, 30, 5, -23, 10, -75), // 13 Measure LNA #define TEST_END 13 TEST_CASE_STRUCT(TC_END, 0, 0, 0, 0, 0, 0), @@ -4926,15 +4937,15 @@ const test_case_t test_case [] = TEST_CASE_STRUCT(TC_MEASURE, TPH_30MHZ, 300, 4, -48, 10, -65), // 14 Calibrate power high mode TEST_CASE_STRUCT(TC_MEASURE, TPH_30MHZ_SWITCH,300, 4, -40, 10, -65), // 14 Calibrate power high mode #define TEST_ATTEN 22 - TEST_CASE_STRUCT(TC_ATTEN, TP_30MHZ, 30, 0, -25, 145, -60), // 20 Measure atten step accuracy + TEST_CASE_STRUCT(TC_ATTEN, TP_30MHZ, 30, 0, -25, 50, -60), // 20 Measure atten step accuracy #define TEST_SPUR 23 TEST_CASE_STRUCT(TC_BELOW, TP_SILENT, 144, 8, -95, 0, 0), // 22 Measure 48MHz spur #define TEST_LEVEL 24 - TEST_CASE_STRUCT(TC_LEVEL, TP_30MHZ, 30.000, 0, CAL_LEVEL, 145, -55), // 23 Measure level - TEST_CASE_STRUCT(TC_LEVEL, TP_30MHZ_LNA, 30.000, 0, CAL_LEVEL, 145, -55), // 23 Measure level - TEST_CASE_STRUCT(TC_LEVEL, TPH_30MHZ, 150, 0, CAL_LEVEL-30, 145, -55), // 23 Measure level + TEST_CASE_STRUCT(TC_LEVEL, TP_30MHZ, 30.000, 0, CAL_LEVEL, 50, -55), // 23 Measure level + TEST_CASE_STRUCT(TC_LEVEL, TP_30MHZ_LNA, 30.000, 0, CAL_LEVEL, 50, -55), // 23 Measure level + TEST_CASE_STRUCT(TC_LEVEL, TPH_30MHZ, 150, 0, CAL_LEVEL-30, 50, -55), // 23 Measure level #define TEST_NOISE 27 - TEST_CASE_STRUCT(TC_LEVEL, TP_SILENT, 201.000, 0, -166, 145, -166), // 23 Measure level + TEST_CASE_STRUCT(TC_LEVEL, TP_SILENT, 201.000, 0, -166, 50, -166), // 23 Measure level #define TEST_NOISE_RBW 28 TEST_CASE_STRUCT(TC_MEASURE, TP_SILENT, 201, 1, -166, 10, -166), // 16 Measure RBW step time }; @@ -5250,6 +5261,7 @@ void test_prepare(int i) setting.measurement = M_OFF; markers[1].enabled = M_DISABLED; markers[2].enabled = M_DISABLED; + setting.stored[TRACE_STORED] = true; setting.tracking = false; //Default test setup setting.atten_step = false; #ifdef TINYSA4 @@ -5274,6 +5286,7 @@ void test_prepare(int i) set_mode(M_LOW); common_silent: set_refer_output(-1); + setting.stored[TRACE_STORED] = true; for (int j = 0; j < setting._sweep_points; j++) stored_t[j] = test_case[i].pass; in_selftest = false; // Otherwise spurs will be visible @@ -5312,7 +5325,7 @@ common_silent: #endif #endif common: - + setting.stored[TRACE_STORED] = true; for (int j = 0; j < setting._sweep_points/2 - W2P(test_case[i].width); j++) stored_t[j] = test_case[i].stop; for (int j = setting._sweep_points/2 + W2P(test_case[i].width); j < setting._sweep_points; j++) diff --git a/ui_sa.c b/ui_sa.c index 87bac0b..4846b12 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -1516,10 +1516,6 @@ static UI_FUNCTION_ADV_CALLBACK(menu_average_acb) // menu_move_back(true); } - -#ifdef __TRACE_MENU__ - - static UI_FUNCTION_ADV_CALLBACK(menu_trace_acb) { (void)item; @@ -1570,13 +1566,13 @@ static UI_FUNCTION_ADV_CALLBACK(menu_subtract_trace_acb) b->bg = LCD_TRACE_1_COLOR+data-1; } else - plot_printf(b->text, sizeof(b->text), "SUBTRACT\nDISABLED"); + plot_printf(b->text, sizeof(b->text), "SUBTRACT\nOFF"); b->icon = (data == setting.subtract[current_trace]) ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP; if (data - 1 == current_trace) b->fg = LCD_DARK_GREY; return; } - subtract_trace(current_trace,data); + subtract_trace(current_trace,data-1); menu_move_back(false); } @@ -1600,7 +1596,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_traces_acb) if (setting.subtract[current_trace]) plot_printf(b->text, sizeof(b->text), "SUBTRACT\nTRACE %d", setting.subtract[current_trace]); else - plot_printf(b->text, sizeof(b->text), "SUBTRACT\nDISABLED"); + plot_printf(b->text, sizeof(b->text), "SUBTRACT\nOFF"); } return; } @@ -1633,10 +1629,6 @@ static UI_FUNCTION_ADV_CALLBACK(menu_traces_acb) // draw_cal_status(); } - - -#endif - static UI_FUNCTION_ADV_CALLBACK(menu_storage_acb) { (void)item; @@ -1718,8 +1710,13 @@ static UI_FUNCTION_ADV_CALLBACK(menu_limit_select_acb) { (void)item; if(b){ - b->icon = setting.limits[data-1].enabled ? BUTTON_ICON_CHECK : BUTTON_ICON_NOCHECK; - b->param_1.i = data; + if (setting.limits[data-1].enabled) { + plot_printf(b->text, sizeof(b->text), "%.6FHz\n%.6fdBm", (float)setting.limits[data-1].frequency, setting.limits[data-1].level); + b->icon = BUTTON_ICON_CHECK; + } else { + plot_printf(b->text, sizeof(b->text), "EMPTY"); + b->icon = BUTTON_ICON_NOCHECK; + } return; } active_limit = data -1; @@ -1736,6 +1733,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_marker_modify_acb) if (active_marker == MARKER_INVALID) return; if(b){ uistat.text[0] = 0; + uistat.text[1] = 0; switch(data) { case M_DELTA: case M_NOISE: @@ -2222,6 +2220,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_connection_acb) #endif // ===[MENU DEFINITION]========================================================= // Back button submenu list + static const menuitem_t menu_back[] = { { MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, NULL } // sentinel @@ -2487,19 +2486,19 @@ const menuitem_t menu_marker_modify[] = { #ifdef __LIMITS__ static const menuitem_t menu_limit_modify[] = { - { MT_KEYPAD, KM_LIMIT_FREQ, "END\nFREQUENCY", "End frequency"}, - { MT_KEYPAD, KM_LIMIT_LEVEL, "LEVEL", "Limit level"}, - { MT_CALLBACK, 0, "DISABLE", menu_limit_disable_cb}, + { MT_KEYPAD, KM_LIMIT_FREQ, "FREQUENCY", "End frequency"}, + { MT_KEYPAD, KM_LIMIT_LEVEL, "LEVEL", "Limit level"}, + { MT_CALLBACK, 0, "DISABLE", menu_limit_disable_cb}, { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; const menuitem_t menu_limit_select[] = { - { MT_ADV_CALLBACK, 1, "LIMIT %d", menu_limit_select_acb }, - { MT_ADV_CALLBACK, 2, "LIMIT %d", menu_limit_select_acb }, - { MT_ADV_CALLBACK, 3, "LIMIT %d", menu_limit_select_acb }, - { MT_ADV_CALLBACK, 4, "LIMIT %d", menu_limit_select_acb }, - { MT_ADV_CALLBACK, 5, "LIMIT %d", menu_limit_select_acb }, - { MT_ADV_CALLBACK, 6, "LIMIT %d", menu_limit_select_acb }, + { MT_ADV_CALLBACK, 1, MT_CUSTOM_LABEL, menu_limit_select_acb }, + { MT_ADV_CALLBACK, 2, MT_CUSTOM_LABEL, menu_limit_select_acb }, + { MT_ADV_CALLBACK, 3, MT_CUSTOM_LABEL, menu_limit_select_acb }, + { MT_ADV_CALLBACK, 4, MT_CUSTOM_LABEL, menu_limit_select_acb }, + { MT_ADV_CALLBACK, 5, MT_CUSTOM_LABEL, menu_limit_select_acb }, + { MT_ADV_CALLBACK, 6, MT_CUSTOM_LABEL, menu_limit_select_acb }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; #endif @@ -2640,8 +2639,6 @@ static const menuitem_t menu_sweep_speed[] = #else { MT_ADV_CALLBACK | MT_LOW,SD_FAST, "FAST", menu_scanning_speed_acb}, #endif - { MT_KEYPAD, KM_SWEEP_TIME, "SWEEP\nTIME", "0..600s, 0=disable"}, // This must be item 3 to match highlighting - { MT_SUBMENU, 0, "SWEEP\nPOINTS", menu_sweep_points}, #ifdef TINYSA4 { MT_KEYPAD, KM_FAST_SPEEDUP,"FAST\nSPEEDUP", "2..20, 0=disable"}, #else @@ -2925,7 +2922,6 @@ static const menuitem_t menu_config[] = { static const menuitem_t menu_storage[] = { -#ifdef __TRACE_MENU__ { MT_ADV_CALLBACK,0, "TRACE %d", menu_storage_acb}, { MT_ADV_CALLBACK,1, "%s", menu_storage_acb}, { MT_ADV_CALLBACK,1, "DISPLAY", menu_storage_acb}, @@ -2933,20 +2929,9 @@ static const menuitem_t menu_storage[] = { MT_ADV_CALLBACK,3, "SUBTRACT", menu_storage_acb}, { MT_ADV_CALLBACK,4, "NORMALIZE", menu_storage_acb}, { MT_ADV_CALLBACK,5, "WRITE\n"S_RARROW"SD",menu_storage_acb}, -#else - { MT_ADV_CALLBACK,0, "STORE\nTRACE", menu_storage_acb}, - { MT_ADV_CALLBACK,1, "CLEAR\nSTORED", menu_storage_acb}, - { MT_ADV_CALLBACK,2, "SUBTRACT\nSTORED",menu_storage_acb}, - { MT_ADV_CALLBACK,3, "NORMALIZE", menu_storage_acb}, -#ifdef TINYSA4 - { MT_ADV_CALLBACK,4, "ACTUAL\n"S_RARROW"SD", menu_storage_acb}, - { MT_ADV_CALLBACK,5, "STORED\n"S_RARROW"SD", menu_storage_acb}, -#endif -#endif { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; -#ifdef __TRACE_MENU__ static const menuitem_t menu_trace[] = { { MT_ADV_CALLBACK,0, "TRACE %d", menu_trace_acb}, @@ -2995,7 +2980,7 @@ static const menuitem_t menu_subtract_trace[] = static const menuitem_t menu_traces[] = { { MT_ADV_CALLBACK,0, "TRACE %d", menu_traces_acb}, - { MT_ADV_CALLBACK,1, "VIEW", menu_traces_acb}, + { MT_ADV_CALLBACK,1, "ENABLE", menu_traces_acb}, { MT_ADV_CALLBACK,2, "FREEZE", menu_traces_acb}, { MT_ADV_CALLBACK,3, MT_CUSTOM_LABEL, menu_traces_acb}, { MT_SUBMENU, 0, "CALC", menu_average}, @@ -3005,34 +2990,16 @@ static const menuitem_t menu_traces[] = #endif { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; -#endif static const menuitem_t menu_display[] = { - { MT_ADV_CALLBACK,0, "PAUSE\nSWEEP", menu_pause_acb}, -#ifndef __TRACE_MENU__ - { MT_SUBMENU, 0, "CALC", menu_average}, - { MT_SUBMENU, 0, "STORAGE", menu_storage}, -// { MT_ADV_CALLBACK,0, "STORE\nTRACE", menu_storage_acb}, -// { MT_ADV_CALLBACK,1, "CLEAR\nSTORED", menu_storage_acb}, -// { MT_ADV_CALLBACK,2, "SUBTRACT\nSTORED",menu_storage_acb}, -#ifdef __VBW__ - { MT_SUBMENU, 0, "VBW", menu_vbw}, - { MT_KEYPAD, KM_EXP_AVER, "EXP\nAVER", NULL}, -#endif + { MT_ADV_CALLBACK,0, "PAUSE\nSWEEP", menu_pause_acb}, + { MT_ADV_CALLBACK,1, "WATER\nFALL", menu_waterfall_acb}, #ifdef __LIMITS__ - { MT_SUBMENU, 0, "LIMITS", menu_limit_select}, -#endif + { MT_SUBMENU, 0, "LIMITS", menu_limit_select}, #endif - { MT_ADV_CALLBACK,4, "WATER\nFALL", menu_waterfall_acb}, - { MT_SUBMENU, 0, "SWEEP\nSETTINGS", menu_sweep_speed}, - { MT_KEYPAD, KM_SWEEP_TIME, "SWEEP\nTIME", "0..600s, 0=disable"}, // This must be item 3 to match highlighting - { MT_SUBMENU, 0, "SWEEP\nPOINTS", menu_sweep_points}, - #ifdef TINYSA4 - { MT_KEYPAD, KM_FAST_SPEEDUP,"FAST\nSPEEDUP", "2..20, 0=disable"}, - #else - { MT_KEYPAD | MT_LOW,KM_FAST_SPEEDUP,"FAST\nSPEEDUP", "2..20, 0=disable"}, - #endif - + { MT_KEYPAD, KM_SWEEP_TIME, "SWEEP\nTIME", "0..600s, 0=disable"}, // This must be item 3 to match highlighting + { MT_SUBMENU, 0, "SWEEP\nPOINTS", menu_sweep_points}, + { MT_SUBMENU, 0, "SWEEP\nACCURACY", menu_sweep_speed}, //#ifdef __REMOTE_DESKTOP__ // { MT_ADV_CALLBACK,0, "SEND\nDISPLAY", menu_send_display_acb}, //#endif @@ -3111,9 +3078,7 @@ static const menuitem_t menu_top[] = { { MT_SUBMENU, 0, "PRESET", menu_load_preset}, { MT_SUBMENU, 0, "FREQUENCY", menu_stimulus}, { MT_SUBMENU, 0, "LEVEL", menu_level}, -#ifdef __TRACE_MENU__ { MT_SUBMENU, 0, "TRACE", menu_traces}, -#endif { MT_SUBMENU, 0, "DISPLAY", menu_display}, { MT_SUBMENU, 0, "MARKER", menu_marker}, { MT_SUBMENU, 0, "MEASURE", menu_measure}, @@ -3127,7 +3092,7 @@ static const menuitem_t menu_top[] = { #define ACTIVE_COLOR RGBHEX(0x007FFF) -static void menu_item_modify_attribute( +static void menu_item_modify_attribute( // To modify menu buttons with keypad modes const menuitem_t *menu, int item, ui_button_t *button) { if (menu == menu_settings) { @@ -3138,11 +3103,12 @@ static void menu_item_modify_attribute( button->icon = setting.step_delay > 0 ? BUTTON_ICON_CHECK_MANUAL : BUTTON_ICON_CHECK_AUTO; else if (item == 1) button->icon =setting.offset_delay > 0 ? BUTTON_ICON_CHECK_MANUAL : BUTTON_ICON_CHECK_AUTO; - } else if (menu == menu_sweep_speed) { - if (item == 3) + } else if (menu == menu_display) { + if (item == 2) button->icon = setting.sweep_time_us != 0 ? BUTTON_ICON_CHECK_MANUAL : BUTTON_ICON_CHECK_AUTO; - else if (item == 5) - button->icon = setting.fast_speedup != 0 ? BUTTON_ICON_CHECK_MANUAL : BUTTON_ICON_CHECK_AUTO; + } else if (menu == menu_sweep_speed) { + if (item == 4) + button->icon = setting.fast_speedup != 0 ? BUTTON_ICON_CHECK_MANUAL : BUTTON_ICON_CHECK_AUTO; } else if (menu == menu_reflevel) { if (item == 1) button->icon = setting.auto_reflevel ? BUTTON_ICON_GROUP: BUTTON_ICON_GROUP_CHECKED;