From cc536a478747681ba2f658d6b86e073af78be12d Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Fri, 10 Apr 2020 13:52:14 +0200 Subject: [PATCH 1/4] Spur table extended --- sa_core.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/sa_core.c b/sa_core.c index fa812ee..eeb80f2 100644 --- a/sa_core.c +++ b/sa_core.c @@ -632,16 +632,38 @@ static const unsigned int spur_alternate_IF = 434000000; static const int spur_table[] = { 580000, + 961000, 1600000, - 1834000, + 1837000, + 2755000, + 2961000, 4933000, 4960000, + 6961000, + 6980000, + 8267000, + 8961000, 10000000, 10960000, + 11600000, 16960000, 22960000, 28960000, + /* +0.52 +6.96 +1.84 +2.77 + + + + 4934 + 4960 + 8928 + 7371 + + /* 870000, 970000, @@ -699,8 +721,9 @@ int avoid_spur(int f) // window = 50000; if (! setting_mode == M_LOW || frequency_IF != spur_IF || actual_rbw > 300.0) return(false); + f = f + window/2; for (unsigned int i = 0; i < (sizeof spur_table)/sizeof(int); i++) { - if (f/window == spur_table[i]/window) { + if (f/window == (spur_table[i] + window/2)/window) { // spur_old_stepdelay = actualStepDelay; // actualStepDelay += 4000; return true; @@ -757,7 +780,8 @@ float perform(bool break_on_operation, int i, int32_t f, int tracking) float RSSI = -150.0; int t = 0; do { - int lf = (uint32_t)(f + (int)(t * 500 * actual_rbw)); + int lf = (uint32_t)(f + (int)((t * 500 - vbwSteps * 250) * actual_rbw)); + if (lf < 0) lf = 0; if (setting_mode == M_LOW && tracking) { setFreq (0, frequency_IF + lf - reffer_freq[setting_refer]); // Offset so fundamental of reffer is visible local_IF = frequency_IF ; From 012f915af9fc262e71c42b46c19e22869c21e06f Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Fri, 10 Apr 2020 16:33:46 +0200 Subject: [PATCH 2/4] Calibrate frequency --- sa_core.c | 24 +++++++++++++++++++++--- si4432.c | 13 ++++++++++--- ui_sa.c | 19 ++++++++++++++++++- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/sa_core.c b/sa_core.c index eeb80f2..7f16767 100644 --- a/sa_core.c +++ b/sa_core.c @@ -634,8 +634,9 @@ static const int spur_table[] = 580000, 961000, 1600000, - 1837000, - 2755000, + 1837000, // Real signal + 2755000, // Real signal + 2760000, 2961000, 4933000, 4960000, @@ -664,7 +665,7 @@ static const int spur_table[] = 7371 -/* + 870000, 970000, 1460000, @@ -714,6 +715,23 @@ static const int spur_table[] = #endif }; +int binary_search(int f) +{ + int L = 0; + int R = (sizeof spur_table)/sizeof(int); + while (L <= R) { + int m = (L + R) / 2; + if (spur_table[m] < f) + L = m + 1; + else if (spur_table[m] > f) + R = m - 1; + else + return m; + } + return 0; +} + + int avoid_spur(int f) { int window = ((int)actual_rbw ) * 1000*2; diff --git a/si4432.c b/si4432.c index 71ba3c7..b79572c 100644 --- a/si4432.c +++ b/si4432.c @@ -218,11 +218,18 @@ float SI4432_force_RBW(int i) float SI4432_RBW_table(int i){ if (i < 0) return 0; - if (i * 4 >= (sizeof RBW_choices) / 2 ) + if (i * 4 >= (int)(sizeof RBW_choices) / 2 ) return 0; return(RBW_choices[i*4-1]); } +int setting_10mhz = 10000000; + +void set_10mhz(int f) +{ + setting_10mhz = f; +} + void SI4432_Set_Frequency ( long Freq ) { int hbsel; long Carrier; @@ -233,8 +240,8 @@ void SI4432_Set_Frequency ( long Freq ) { hbsel = 0; } int sbsel = 1; - int N = Freq / 10000000; - Carrier = ( 4 * ( Freq - N * 10000000 )) / 625; + int N = Freq / setting_10mhz; + Carrier = ( 4 * ( Freq - N * setting_10mhz )) / 625; int Freq_Band = ( N - 24 ) | ( hbsel << 5 ) | ( sbsel << 6 ); #if 0 SI4432_Write_Byte ( 0x75, Freq_Band ); diff --git a/ui_sa.c b/ui_sa.c index f86c096..0b4aa47 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -55,6 +55,8 @@ extern int setting_auto_reflevel; extern int setting_auto_attenuation; extern int setting_reflevel; extern int setting_scale; +extern int setting_10mhz; +void set_10mhz(int); void SetModulation(int); extern int setting_modulation; void set_measurement(int); @@ -65,7 +67,7 @@ extern int setting_step_delay; enum { KM_START=1, KM_STOP, KM_CENTER, KM_SPAN, KM_CW, KM_REFPOS, KM_SCALE, KM_ATTENUATION, - KM_ACTUALPOWER, KM_IF, KM_SAMPLETIME, KM_DRIVE, KM_LOWOUTLEVEL, KM_DECAY, KM_NOISE + KM_ACTUALPOWER, KM_IF, KM_SAMPLETIME, KM_DRIVE, KM_LOWOUTLEVEL, KM_DECAY, KM_NOISE, KM_10MHZ }; @@ -173,6 +175,7 @@ static const keypads_t * const keypads_mode_tbl[] = { keypads_level, // KM_LOWOUTLEVEL keypads_level, // KM_DECAY keypads_level, // KM_NOISE + keypads_level, // KM_10MHz }; #ifdef __VNA__ @@ -610,6 +613,7 @@ const menuitem_t menu_lowoutputmode[] = { { MT_FORM | MT_KEYPAD, KM_LOWOUTLEVEL, "LEVEL: %s", NULL}, { MT_FORM | MT_SUBMENU, 0, "MODULATION: %s", menu_modulation}, { MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", NULL}, + { MT_FORM | MT_KEYPAD, KM_10MHZ, "10MHZ: %s", NULL}, { MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel }; @@ -787,6 +791,7 @@ static const menuitem_t menu_settings2[] = { MT_CALLBACK, 2, "BPF", menu_settings2_cb}, { MT_KEYPAD, KM_DECAY, "\2HOLD\0TIME", NULL}, { MT_KEYPAD, KM_NOISE, "\2NOISE\0LEVEL", NULL}, + { MT_KEYPAD, KM_10MHZ, "\00210MHZ\0ACTUAL", NULL}, { MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, NULL } // sentinel }; @@ -1090,6 +1095,11 @@ static void fetch_numeric_target(void) uistat.value = setting_noise; plot_printf(uistat.text, sizeof uistat.text, "%3d", uistat.value); break; + case KM_10MHZ: + uistat.value = setting_10mhz; + plot_printf(uistat.text, sizeof uistat.text, "%3.6fMHz", uistat.value / 1000000.0); + break; + } { @@ -1157,5 +1167,12 @@ set_numeric_value(void) case KM_NOISE: set_noise(uistat.value); break; + case KM_10MHZ: + if (uistat.value < 9000000) { + set_10mhz(setting_10mhz + uistat.value); + } else + set_10mhz(uistat.value); + dirty = true; + break; } } From 6ae3ef90190425cbb0a1d3a76707bd7a3ef594a8 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Fri, 10 Apr 2020 17:04:46 +0200 Subject: [PATCH 3/4] Prepare for 8 menu buttons --- ui.c | 9 +++++---- ui_sa.c | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui.c b/ui.c index 874a530..adbcfa0 100644 --- a/ui.c +++ b/ui.c @@ -1497,7 +1497,7 @@ draw_menu_buttons(const menuitem_t *menu) { int i = 0; char text[30]; - for (i = 0; i < 7; i++) { + for (i = 0; i < 8; i++) { const char *l1, *l2; if (MT_MASK(menu[i].type) == MT_NONE) break; @@ -1597,7 +1597,7 @@ menu_apply_touch(void) int i; touch_position(&touch_x, &touch_y); - for (i = 0; i < 7; i++) { + for (i = 0; i < 8; i++) { if (MT_MASK(menu[i].type) == MT_NONE) break; if (MT_MASK(menu[i].type == MT_BLANK) || MT_MASK(menu[i].type) == MT_TITLE) @@ -1629,8 +1629,9 @@ draw_menu(void) static void erase_menu_buttons(void) { - ili9341_fill(area_width, 0, 320 - area_width, area_height, DEFAULT_BG_COLOR); -// ili9341_fill(320-MENU_BUTTON_WIDTH, 0, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT*7, DEFAULT_BG_COLOR); +// ili9341_fill(area_width, 0, 320 - area_width, area_height, DEFAULT_BG_COLOR); + ili9341_fill(320-MENU_BUTTON_WIDTH, 0, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT*8, DEFAULT_BG_COLOR); + draw_frequencies(); } static void diff --git a/ui_sa.c b/ui_sa.c index 0b4aa47..2a17436 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -731,6 +731,7 @@ static const menuitem_t menu_stimulus[8] = { { MT_KEYPAD, KM_SPAN, "SPAN", NULL}, { MT_KEYPAD, KM_CW, "CW FREQ", NULL}, { MT_CALLBACK,0, "\2PAUSE\0SWEEP", menu_pause_cb}, + { MT_SUBMENU,0, "RBW", menu_rbw}, { MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, NULL } // sentinel }; From 5f3aed584464432462cc98f84dae53b1d411b4f2 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Fri, 10 Apr 2020 17:49:25 +0200 Subject: [PATCH 4/4] Menu structure adapted --- main.c | 14 ++++- ui.c | 3 +- ui_sa.c | 186 ++++++++++++++++++++++++++++++++------------------------ 3 files changed, 119 insertions(+), 84 deletions(-) diff --git a/main.c b/main.c index 2c3e0e9..337a0ec 100644 --- a/main.c +++ b/main.c @@ -129,9 +129,13 @@ static THD_FUNCTION(Thread1, arg) completed = sweep(true); sweep_mode&=~SWEEP_ONCE; } else if (sweep_mode & SWEEP_SELFTEST) { - self_test(); // call from lowest level to save stack space + // call from lowest level to save stack space + self_test(); + sweep_mode = SWEEP_ENABLE; } else if (sweep_mode & SWEEP_CALIBRATE) { - calibrate(); // call from lowest level to save stack space + // call from lowest level to save stack space + calibrate(); + sweep_mode = SWEEP_ENABLE; } else { __WFI(); } @@ -168,6 +172,12 @@ static THD_FUNCTION(Thread1, arg) } } +int +is_paused(void) +{ + return !(sweep_mode & SWEEP_ENABLE); +} + static inline void pause_sweep(void) { diff --git a/ui.c b/ui.c index adbcfa0..f8bbddd 100644 --- a/ui.c +++ b/ui.c @@ -720,11 +720,12 @@ get_marker_frequency(int marker) static void menu_marker_op_cb(int item, uint8_t data) { + (void)item; uint32_t freq = get_marker_frequency(active_marker); if (freq == 0) return; // no active marker - switch (item) { + switch (data) { case 0: /* MARKER->START */ case 1: /* MARKER->STOP */ case 2: /* MARKER->CENTER */ diff --git a/ui_sa.c b/ui_sa.c index 2a17436..887cad0 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -15,7 +15,7 @@ void SetAttenuation(int); int GetAttenuation(void); void set_auto_attenuation(void); void set_auto_reflevel(void); - +int is_paused(void); void SetPowerLevel(int); void SetGenerate(int); void SetRBW(int); @@ -488,7 +488,7 @@ int menu_dBper_value[]={1,2,5,10,20}; static void menu_dBper_cb(int item, uint8_t data) { (void)item; - SetScale(menu_dBper_value[data]); + SetScale(data); menu_move_back(); ui_mode_normal(); // draw_cal_status(); @@ -542,8 +542,8 @@ static void menu_pause_cb(int item, uint8_t data) (void) data; (void) item; toggle_sweep(); - menu_move_back(); - ui_mode_normal(); +// menu_move_back(); +// ui_mode_normal(); draw_menu(); // draw_cal_status(); } @@ -652,11 +652,11 @@ static const menuitem_t menu_rbw[] = { static const menuitem_t menu_dBper[] = { - { MT_CALLBACK, 0, " 1dB/", menu_dBper_cb}, - { MT_CALLBACK, 1, " 2dB/", menu_dBper_cb}, - { MT_CALLBACK, 2, " 5dB/", menu_dBper_cb}, - { MT_CALLBACK, 3, " 10dB/", menu_dBper_cb}, - { MT_CALLBACK, 4, " 20dB/", menu_dBper_cb}, + { MT_CALLBACK, 1, " 1dB/", menu_dBper_cb}, + { MT_CALLBACK, 2, " 2dB/", menu_dBper_cb}, + { MT_CALLBACK, 5, " 5dB/", menu_dBper_cb}, + { MT_CALLBACK, 10," 10dB/", menu_dBper_cb}, + { MT_CALLBACK, 20," 20dB/", menu_dBper_cb}, { MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, NULL } // sentinel }; @@ -688,22 +688,6 @@ static const menuitem_t menu_atten[] = { { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel }; -static const menuitem_t menu_acquire[] = { - { MT_CALLBACK, 0, "RESET", menu_autosettings_cb}, - { MT_SUBMENU, 0, "ATTEN", menu_atten}, - { MT_SUBMENU,0, "RBW", menu_rbw}, - { MT_SUBMENU,0, "AVER", menu_average}, - { MT_CANCEL, 0, S_LARROW" BACK", NULL }, - { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel -}; - -static const menuitem_t menu_acquirehigh[] = { - { MT_CALLBACK, 0, "RESET", menu_autosettings_cb}, - { MT_SUBMENU,0, "RBW", menu_rbw}, - { MT_SUBMENU,0, "AVER", menu_average}, - { MT_CANCEL, 0, S_LARROW" BACK", NULL }, - { MT_NONE, 0, NULL, NULL } // sentinel -}; static const menuitem_t menu_reflevel[] = { { MT_CALLBACK,0, "AUTO", menu_reflevel_cb}, @@ -713,29 +697,6 @@ static const menuitem_t menu_reflevel[] = { }; -static const menuitem_t menu_display[] = { - { MT_SUBMENU, 0, "\2REF\0LEVEL", menu_reflevel}, - { MT_SUBMENU, 0, "\2SCALE/\0DIV",menu_dBper}, - { MT_CALLBACK,0, "STORE", menu_storage_cb}, - { MT_CALLBACK,1, "CLEAR", menu_storage_cb}, - { MT_CALLBACK,2, "SUBTRACT", menu_storage_cb}, - { MT_CALLBACK,3, "WATERFALL", menu_storage_cb}, - { MT_CANCEL, 0, S_LARROW" BACK", NULL }, - { MT_NONE, 0, NULL, NULL } // sentinel -}; - -static const menuitem_t menu_stimulus[8] = { - { MT_KEYPAD, KM_START, "START", NULL}, - { MT_KEYPAD, KM_STOP, "STOP", NULL}, - { MT_KEYPAD, KM_CENTER, "CENTER", NULL}, - { MT_KEYPAD, KM_SPAN, "SPAN", NULL}, - { MT_KEYPAD, KM_CW, "CW FREQ", NULL}, - { MT_CALLBACK,0, "\2PAUSE\0SWEEP", menu_pause_cb}, - { MT_SUBMENU,0, "RBW", menu_rbw}, - { MT_CANCEL, 0, S_LARROW" BACK", NULL }, - { MT_NONE, 0, NULL, NULL } // sentinel -}; - static const menuitem_t menu_marker_type[] = { { MT_CALLBACK, M_REFERENCE, "REFERENCE", menu_marker_type_cb}, @@ -771,10 +732,10 @@ static const menuitem_t menu_marker_sel[] = { static const menuitem_t menu_marker[] = { { MT_SUBMENU, 0, "\2SELECT\0MARKER", menu_marker_sel}, { MT_SUBMENU, 0, "\2MARKER\0TYPE", menu_marker_type}, - { MT_CALLBACK, 0, S_RARROW"START", menu_marker_op_cb}, - { MT_CALLBACK, 0, S_RARROW"STOP", menu_marker_op_cb}, - { MT_CALLBACK, 0, S_RARROW"CENTER", menu_marker_op_cb}, - { MT_CALLBACK, 0, S_RARROW"SPAN", menu_marker_op_cb}, + { MT_CALLBACK, ST_START, S_RARROW"START", menu_marker_op_cb}, + { MT_CALLBACK, ST_STOP, S_RARROW"STOP", menu_marker_op_cb}, + { MT_CALLBACK, ST_CENTER, S_RARROW"CENTER", menu_marker_op_cb}, + { MT_CALLBACK, ST_SPAN, S_RARROW"SPAN", menu_marker_op_cb}, { MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, NULL } // sentinel }; @@ -857,6 +818,65 @@ static const menuitem_t menu_config[] = { { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel }; +static const menuitem_t menu_acquire[] = { + { MT_CALLBACK, 0, "RESET", menu_autosettings_cb}, + { MT_SUBMENU, 0, "ATTEN", menu_atten}, + { MT_SUBMENU,0, "RBW", menu_rbw}, + { MT_SUBMENU,0, "AVER", menu_average}, + { MT_CANCEL, 0, S_LARROW" BACK", NULL }, + { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel +}; + +static const menuitem_t menu_acquirehigh[] = { + { MT_CALLBACK, 0, "RESET", menu_autosettings_cb}, + { MT_SUBMENU,0, "RBW", menu_rbw}, + { MT_SUBMENU,0, "AVER", menu_average}, + { MT_CANCEL, 0, S_LARROW" BACK", NULL }, + { MT_NONE, 0, NULL, NULL } // sentinel +}; + +static const menuitem_t menu_display[] = { + { MT_CALLBACK,0, "\2PAUSE\0SWEEP", menu_pause_cb}, +// { MT_SUBMENU, 0, "\2REF\0LEVEL", menu_reflevel}, +// { MT_SUBMENU, 0, "\2SCALE/\0DIV",menu_dBper}, + { MT_CALLBACK,0, "STORE", menu_storage_cb}, + { MT_CALLBACK,1, "CLEAR", menu_storage_cb}, + { MT_CALLBACK,2, "SUBTRACT", menu_storage_cb}, + { MT_CALLBACK,3, "WATERFALL", menu_storage_cb}, + { MT_CANCEL, 0, S_LARROW" BACK", NULL }, + { MT_NONE, 0, NULL, NULL } // sentinel +}; + +static const menuitem_t menu_levelhigh[] = { + { MT_SUBMENU, 0, "\2REF\0LEVEL", menu_reflevel}, + { MT_SUBMENU, 0, "\2SCALE/\0DIV",menu_dBper}, + { MT_SUBMENU,0, "AVER", menu_average}, + { MT_CANCEL, 0, S_LARROW" BACK",NULL }, + { MT_NONE, 0, NULL, NULL } // sentinel +}; + +static const menuitem_t menu_level[] = { + { MT_SUBMENU, 0, "\2REF\0LEVEL", menu_reflevel}, + { MT_SUBMENU, 0, "\2SCALE/\0DIV",menu_dBper}, + { MT_SUBMENU, 0, "ATTEN", menu_atten}, + { MT_SUBMENU,0, "AVER", menu_average}, + { MT_CANCEL, 0, S_LARROW" BACK",NULL }, + { MT_NONE, 0, NULL, NULL } // sentinel +}; + +static const menuitem_t menu_stimulus[] = { + { MT_KEYPAD, KM_START, "START", NULL}, + { MT_KEYPAD, KM_STOP, "STOP", NULL}, + { MT_KEYPAD, KM_CENTER, "CENTER", NULL}, + { MT_KEYPAD, KM_SPAN, "SPAN", NULL}, + { MT_KEYPAD, KM_CW, "CW FREQ", NULL}, + { MT_SUBMENU,0, "RBW", menu_rbw}, + { MT_CANCEL, 0, S_LARROW" BACK", NULL }, + { MT_NONE, 0, NULL, NULL } // sentinel +}; + + + static const menuitem_t menu_mode[] = { { MT_FORM | MT_TITLE, 0, "MODE", NULL}, { MT_FORM | MT_CALLBACK, 0, "LOW INPUT", menu_mode_cb}, @@ -869,6 +889,30 @@ static const menuitem_t menu_mode[] = { { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel }; #if 1 +const menuitem_t menu_top[] = { + { MT_CALLBACK, 0, "RESET", menu_autosettings_cb}, + { MT_SUBMENU, 0, "FREQ", menu_stimulus}, + { MT_SUBMENU, 0, "LEVEL", menu_level}, + { MT_SUBMENU, 0, "DISPLAY", menu_display}, + { MT_SUBMENU, 0, "MARKER", menu_marker}, + { MT_SUBMENU, 0, "SETTINGS", menu_settings}, + { MT_CANCEL, 0, S_LARROW" MODE",NULL}, + { MT_NONE, 0, NULL, NULL } // sentinel, + // MENUITEM_CLOSE, +}; + +const menuitem_t menu_tophigh[] = { + { MT_CALLBACK, 0, "RESET", menu_autosettings_cb}, + { MT_SUBMENU, 0, "FREQ", menu_stimulus}, + { MT_SUBMENU, 0, "LEVEL", menu_levelhigh}, + { MT_SUBMENU, 0, "DISPLAY", menu_display}, + { MT_SUBMENU, 0, "MARKER", menu_marker}, + { MT_SUBMENU, 0, "SETTINGS", menu_settingshigh}, + { MT_CANCEL, 0, S_LARROW" MODE",NULL}, + { MT_NONE, 0, NULL, NULL } // sentinel, + // MENUITEM_CLOSE, +}; +#else const menuitem_t menu_top[] = { { MT_SUBMENU, 0, "ACQUIRE", menu_acquire}, { MT_SUBMENU, 0, "FREQ", menu_stimulus}, @@ -893,30 +937,6 @@ const menuitem_t menu_tophigh[] = { MT_NONE, 0, NULL, NULL } // sentinel, // MENUITEM_CLOSE, }; -#else -const menuitem_t menu_top[] = { - { MT_CALLBACK, 0, "AUTO", menu_autosettings_cb}, - { MT_SUBMENU, 0, "SCAN", menu_stimulus}, - { MT_SUBMENU, 0, "MARKER", menu_marker}, - { MT_SUBMENU, 0, "DISPLAY", menu_scale}, - { MT_SUBMENU, 0, "STORAGE", menu_storage}, - { MT_SUBMENU, 0, "SETTINGS", menu_settings}, - { MT_CANCEL, 0, S_LARROW" MODE",NULL}, - { MT_NONE, 0, NULL, NULL } // sentinel, - // MENUITEM_CLOSE, -}; - -const menuitem_t menu_tophigh[] = { - { MT_CALLBACK, 0, "AUTO", menu_autosettings_cb}, - { MT_SUBMENU, 0, "SCAN", menu_stimulus}, - { MT_SUBMENU, 0, "MARKER", menu_marker}, - { MT_SUBMENU, 0, "DISPLAY", menu_scalehigh}, - { MT_SUBMENU, 0, "STORAGE", menu_storage}, - { MT_SUBMENU, 0, "SETTINGS", menu_settingshigh}, - { MT_CANCEL, 0, S_LARROW" MODE",NULL}, - { MT_NONE, 0, NULL, NULL } // sentinel, - // MENUITEM_CLOSE, -}; #endif // ===[MENU DEFINITION END]====================================================== @@ -941,6 +961,7 @@ static void menu_item_modify_attribute( const menuitem_t *menu, int item, uint16_t *fg, uint16_t *bg) { int mark = false; + int data = menu[item].data; if (menu == menu_mode) { if (item == GetMode()+1) { mark = true; @@ -970,7 +991,7 @@ static void menu_item_modify_attribute( mark = true; } } else if (menu == menu_dBper) { - if (menu_dBper_value[item] == get_trace_scale(1)){ + if (data == get_trace_scale(1)){ mark = true; } } else if (menu == menu_rbw) { @@ -979,18 +1000,21 @@ static void menu_item_modify_attribute( } } else if (menu == menu_drive || menu == menu_drive_wide || menu == menu_drive_wide2|| menu == menu_drive_wide3) { - if (menu[item].data == setting_drive){ + if (data == setting_drive){ mark = true; } } else if (menu == menu_display) { - if (item ==2 && GetStorage()){ + if (item ==0 && is_paused()){ + mark = true; + } + if (item ==1 && GetStorage()){ mark = true; } - if (item == 4 && GetSubtractStorage()){ + if (item == 3 && GetSubtractStorage()){ mark = true; } - if (item == 5 && get_waterfall()){ + if (item == 4 && get_waterfall()){ mark = true; } } else if (menu == menu_settings2 || menu == menu_settingshigh2) {