Merge branch 'tinySA' into tinySA-v0.2

tinySA-v0.2
erikkaashoek 6 years ago
commit 2ff78fa061

@ -129,9 +129,13 @@ static THD_FUNCTION(Thread1, arg)
completed = sweep(true); completed = sweep(true);
sweep_mode&=~SWEEP_ONCE; sweep_mode&=~SWEEP_ONCE;
} else if (sweep_mode & SWEEP_SELFTEST) { } 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) { } 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 { } else {
__WFI(); __WFI();
} }
@ -168,6 +172,12 @@ static THD_FUNCTION(Thread1, arg)
} }
} }
int
is_paused(void)
{
return !(sweep_mode & SWEEP_ENABLE);
}
static inline void static inline void
pause_sweep(void) pause_sweep(void)
{ {

@ -632,17 +632,40 @@ static const unsigned int spur_alternate_IF = 434000000;
static const int spur_table[] = static const int spur_table[] =
{ {
580000, 580000,
961000,
1600000, 1600000,
1834000, 1837000, // Real signal
2755000, // Real signal
2760000,
2961000,
4933000, 4933000,
4960000, 4960000,
6961000,
6980000,
8267000,
8961000,
10000000, 10000000,
10960000, 10960000,
11600000,
16960000, 16960000,
22960000, 22960000,
28960000, 28960000,
/* /*
0.52
6.96
1.84
2.77
4934
4960
8928
7371
870000, 870000,
970000, 970000,
1460000, 1460000,
@ -692,6 +715,23 @@ static const int spur_table[] =
#endif #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 avoid_spur(int f)
{ {
int window = ((int)actual_rbw ) * 1000*2; int window = ((int)actual_rbw ) * 1000*2;
@ -699,8 +739,9 @@ int avoid_spur(int f)
// window = 50000; // window = 50000;
if (! setting_mode == M_LOW || frequency_IF != spur_IF || actual_rbw > 300.0) if (! setting_mode == M_LOW || frequency_IF != spur_IF || actual_rbw > 300.0)
return(false); return(false);
f = f + window/2;
for (unsigned int i = 0; i < (sizeof spur_table)/sizeof(int); i++) { 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; // spur_old_stepdelay = actualStepDelay;
// actualStepDelay += 4000; // actualStepDelay += 4000;
return true; return true;
@ -757,7 +798,8 @@ float perform(bool break_on_operation, int i, int32_t f, int tracking)
float RSSI = -150.0; float RSSI = -150.0;
int t = 0; int t = 0;
do { 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) { if (setting_mode == M_LOW && tracking) {
setFreq (0, frequency_IF + lf - reffer_freq[setting_refer]); // Offset so fundamental of reffer is visible setFreq (0, frequency_IF + lf - reffer_freq[setting_refer]); // Offset so fundamental of reffer is visible
local_IF = frequency_IF ; local_IF = frequency_IF ;

@ -221,11 +221,18 @@ float SI4432_force_RBW(int i)
float SI4432_RBW_table(int i){ float SI4432_RBW_table(int i){
if (i < 0) if (i < 0)
return 0; return 0;
if (i * 4 >= (sizeof RBW_choices) / 2 ) if (i * 4 >= (int)(sizeof RBW_choices) / 2 )
return 0; return 0;
return(RBW_choices[i*4-1]); return(RBW_choices[i*4-1]);
} }
int setting_10mhz = 10000000;
void set_10mhz(int f)
{
setting_10mhz = f;
}
void SI4432_Set_Frequency ( long Freq ) { void SI4432_Set_Frequency ( long Freq ) {
int hbsel; int hbsel;
long Carrier; long Carrier;
@ -236,8 +243,8 @@ void SI4432_Set_Frequency ( long Freq ) {
hbsel = 0; hbsel = 0;
} }
int sbsel = 1; int sbsel = 1;
int N = Freq / 10000000; int N = Freq / setting_10mhz;
Carrier = ( 4 * ( Freq - N * 10000000 )) / 625; Carrier = ( 4 * ( Freq - N * setting_10mhz )) / 625;
int Freq_Band = ( N - 24 ) | ( hbsel << 5 ) | ( sbsel << 6 ); int Freq_Band = ( N - 24 ) | ( hbsel << 5 ) | ( sbsel << 6 );
#if 0 #if 0
SI4432_Write_Byte ( 0x75, Freq_Band ); SI4432_Write_Byte ( 0x75, Freq_Band );

12
ui.c

@ -720,11 +720,12 @@ get_marker_frequency(int marker)
static void static void
menu_marker_op_cb(int item, uint8_t data) menu_marker_op_cb(int item, uint8_t data)
{ {
(void)item;
uint32_t freq = get_marker_frequency(active_marker); uint32_t freq = get_marker_frequency(active_marker);
if (freq == 0) if (freq == 0)
return; // no active marker return; // no active marker
switch (item) { switch (data) {
case 0: /* MARKER->START */ case 0: /* MARKER->START */
case 1: /* MARKER->STOP */ case 1: /* MARKER->STOP */
case 2: /* MARKER->CENTER */ case 2: /* MARKER->CENTER */
@ -1497,7 +1498,7 @@ draw_menu_buttons(const menuitem_t *menu)
{ {
int i = 0; int i = 0;
char text[30]; char text[30];
for (i = 0; i < 7; i++) { for (i = 0; i < 8; i++) {
const char *l1, *l2; const char *l1, *l2;
if (MT_MASK(menu[i].type) == MT_NONE) if (MT_MASK(menu[i].type) == MT_NONE)
break; break;
@ -1597,7 +1598,7 @@ menu_apply_touch(void)
int i; int i;
touch_position(&touch_x, &touch_y); 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) if (MT_MASK(menu[i].type) == MT_NONE)
break; break;
if (MT_MASK(menu[i].type == MT_BLANK) || MT_MASK(menu[i].type) == MT_TITLE) if (MT_MASK(menu[i].type == MT_BLANK) || MT_MASK(menu[i].type) == MT_TITLE)
@ -1629,8 +1630,9 @@ draw_menu(void)
static void static void
erase_menu_buttons(void) erase_menu_buttons(void)
{ {
ili9341_fill(area_width, 0, 320 - area_width, area_height, 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*7, DEFAULT_BG_COLOR); ili9341_fill(320-MENU_BUTTON_WIDTH, 0, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT*8, DEFAULT_BG_COLOR);
draw_frequencies();
} }
static void static void

@ -15,7 +15,7 @@ void SetAttenuation(int);
int GetAttenuation(void); int GetAttenuation(void);
void set_auto_attenuation(void); void set_auto_attenuation(void);
void set_auto_reflevel(void); void set_auto_reflevel(void);
int is_paused(void);
void SetPowerLevel(int); void SetPowerLevel(int);
void SetGenerate(int); void SetGenerate(int);
void SetRBW(int); void SetRBW(int);
@ -55,6 +55,8 @@ extern int setting_auto_reflevel;
extern int setting_auto_attenuation; extern int setting_auto_attenuation;
extern int setting_reflevel; extern int setting_reflevel;
extern int setting_scale; extern int setting_scale;
extern int setting_10mhz;
void set_10mhz(int);
void SetModulation(int); void SetModulation(int);
extern int setting_modulation; extern int setting_modulation;
void set_measurement(int); void set_measurement(int);
@ -65,7 +67,7 @@ extern int setting_step_delay;
enum { enum {
KM_START=1, KM_STOP, KM_CENTER, KM_SPAN, KM_CW, KM_REFPOS, KM_SCALE, KM_ATTENUATION, 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_LOWOUTLEVEL
keypads_level, // KM_DECAY keypads_level, // KM_DECAY
keypads_level, // KM_NOISE keypads_level, // KM_NOISE
keypads_level, // KM_10MHz
}; };
#ifdef __VNA__ #ifdef __VNA__
@ -485,7 +488,7 @@ int menu_dBper_value[]={1,2,5,10,20};
static void menu_dBper_cb(int item, uint8_t data) static void menu_dBper_cb(int item, uint8_t data)
{ {
(void)item; (void)item;
SetScale(menu_dBper_value[data]); SetScale(data);
menu_move_back(); menu_move_back();
ui_mode_normal(); ui_mode_normal();
// draw_cal_status(); // draw_cal_status();
@ -539,8 +542,8 @@ static void menu_pause_cb(int item, uint8_t data)
(void) data; (void) data;
(void) item; (void) item;
toggle_sweep(); toggle_sweep();
menu_move_back(); // menu_move_back();
ui_mode_normal(); // ui_mode_normal();
draw_menu(); draw_menu();
// draw_cal_status(); // draw_cal_status();
} }
@ -610,6 +613,7 @@ const menuitem_t menu_lowoutputmode[] = {
{ MT_FORM | MT_KEYPAD, KM_LOWOUTLEVEL, "LEVEL: %s", NULL}, { MT_FORM | MT_KEYPAD, KM_LOWOUTLEVEL, "LEVEL: %s", NULL},
{ MT_FORM | MT_SUBMENU, 0, "MODULATION: %s", menu_modulation}, { MT_FORM | MT_SUBMENU, 0, "MODULATION: %s", menu_modulation},
{ MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", NULL}, { 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_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -648,11 +652,11 @@ static const menuitem_t menu_rbw[] = {
static const menuitem_t menu_dBper[] = { static const menuitem_t menu_dBper[] = {
{ MT_CALLBACK, 0, " 1dB/", menu_dBper_cb}, { MT_CALLBACK, 1, " 1dB/", menu_dBper_cb},
{ MT_CALLBACK, 1, " 2dB/", menu_dBper_cb}, { MT_CALLBACK, 2, " 2dB/", menu_dBper_cb},
{ MT_CALLBACK, 2, " 5dB/", menu_dBper_cb}, { MT_CALLBACK, 5, " 5dB/", menu_dBper_cb},
{ MT_CALLBACK, 3, " 10dB/", menu_dBper_cb}, { MT_CALLBACK, 10," 10dB/", menu_dBper_cb},
{ MT_CALLBACK, 4, " 20dB/", menu_dBper_cb}, { MT_CALLBACK, 20," 20dB/", menu_dBper_cb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -684,22 +688,6 @@ static const menuitem_t menu_atten[] = {
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { 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[] = { static const menuitem_t menu_reflevel[] = {
{ MT_CALLBACK,0, "AUTO", menu_reflevel_cb}, { MT_CALLBACK,0, "AUTO", menu_reflevel_cb},
@ -709,28 +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_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel
};
static const menuitem_t menu_marker_type[] = { static const menuitem_t menu_marker_type[] = {
{ MT_CALLBACK, M_REFERENCE, "REFERENCE", menu_marker_type_cb}, { MT_CALLBACK, M_REFERENCE, "REFERENCE", menu_marker_type_cb},
@ -766,10 +732,10 @@ static const menuitem_t menu_marker_sel[] = {
static const menuitem_t menu_marker[] = { static const menuitem_t menu_marker[] = {
{ MT_SUBMENU, 0, "\2SELECT\0MARKER", menu_marker_sel}, { MT_SUBMENU, 0, "\2SELECT\0MARKER", menu_marker_sel},
{ MT_SUBMENU, 0, "\2MARKER\0TYPE", menu_marker_type}, { MT_SUBMENU, 0, "\2MARKER\0TYPE", menu_marker_type},
{ MT_CALLBACK, 0, S_RARROW"START", menu_marker_op_cb}, { MT_CALLBACK, ST_START, S_RARROW"START", menu_marker_op_cb},
{ MT_CALLBACK, 0, S_RARROW"STOP", menu_marker_op_cb}, { MT_CALLBACK, ST_STOP, S_RARROW"STOP", menu_marker_op_cb},
{ MT_CALLBACK, 0, S_RARROW"CENTER", menu_marker_op_cb}, { MT_CALLBACK, ST_CENTER, S_RARROW"CENTER", menu_marker_op_cb},
{ MT_CALLBACK, 0, S_RARROW"SPAN", menu_marker_op_cb}, { MT_CALLBACK, ST_SPAN, S_RARROW"SPAN", menu_marker_op_cb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -787,6 +753,7 @@ static const menuitem_t menu_settings2[] =
{ MT_CALLBACK, 2, "BPF", menu_settings2_cb}, { MT_CALLBACK, 2, "BPF", menu_settings2_cb},
{ MT_KEYPAD, KM_DECAY, "\2HOLD\0TIME", NULL}, { MT_KEYPAD, KM_DECAY, "\2HOLD\0TIME", NULL},
{ MT_KEYPAD, KM_NOISE, "\2NOISE\0LEVEL", NULL}, { MT_KEYPAD, KM_NOISE, "\2NOISE\0LEVEL", NULL},
{ MT_KEYPAD, KM_10MHZ, "\00210MHZ\0ACTUAL", NULL},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -851,6 +818,65 @@ static const menuitem_t menu_config[] = {
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { 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[] = { static const menuitem_t menu_mode[] = {
{ MT_FORM | MT_TITLE, 0, "MODE", NULL}, { MT_FORM | MT_TITLE, 0, "MODE", NULL},
{ MT_FORM | MT_CALLBACK, 0, "LOW INPUT", menu_mode_cb}, { MT_FORM | MT_CALLBACK, 0, "LOW INPUT", menu_mode_cb},
@ -863,6 +889,30 @@ static const menuitem_t menu_mode[] = {
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
#if 1 #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[] = { const menuitem_t menu_top[] = {
{ MT_SUBMENU, 0, "ACQUIRE", menu_acquire}, { MT_SUBMENU, 0, "ACQUIRE", menu_acquire},
{ MT_SUBMENU, 0, "FREQ", menu_stimulus}, { MT_SUBMENU, 0, "FREQ", menu_stimulus},
@ -887,30 +937,6 @@ const menuitem_t menu_tophigh[] =
{ MT_NONE, 0, NULL, NULL } // sentinel, { MT_NONE, 0, NULL, NULL } // sentinel,
// MENUITEM_CLOSE, // 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 #endif
// ===[MENU DEFINITION END]====================================================== // ===[MENU DEFINITION END]======================================================
@ -935,6 +961,7 @@ static void menu_item_modify_attribute(
const menuitem_t *menu, int item, uint16_t *fg, uint16_t *bg) const menuitem_t *menu, int item, uint16_t *fg, uint16_t *bg)
{ {
int mark = false; int mark = false;
int data = menu[item].data;
if (menu == menu_mode) { if (menu == menu_mode) {
if (item == GetMode()+1) { if (item == GetMode()+1) {
mark = true; mark = true;
@ -964,7 +991,7 @@ static void menu_item_modify_attribute(
mark = true; mark = true;
} }
} else if (menu == menu_dBper) { } else if (menu == menu_dBper) {
if (menu_dBper_value[item] == get_trace_scale(1)){ if (data == get_trace_scale(1)){
mark = true; mark = true;
} }
} else if (menu == menu_rbw) { } else if (menu == menu_rbw) {
@ -973,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) { } 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; mark = true;
} }
} else if (menu == menu_display) { } else if (menu == menu_display) {
if (item ==2 && GetStorage()){ if (item ==0 && is_paused()){
mark = true;
}
if (item ==1 && GetStorage()){
mark = true; mark = true;
} }
if (item == 4 && GetSubtractStorage()){ if (item == 3 && GetSubtractStorage()){
mark = true; mark = true;
} }
if (item == 5 && get_waterfall()){ if (item == 4 && get_waterfall()){
mark = true; mark = true;
} }
} else if (menu == menu_settings2 || menu == menu_settingshigh2) { } else if (menu == menu_settings2 || menu == menu_settingshigh2) {
@ -1090,6 +1120,11 @@ static void fetch_numeric_target(void)
uistat.value = setting_noise; uistat.value = setting_noise;
plot_printf(uistat.text, sizeof uistat.text, "%3d", uistat.value); plot_printf(uistat.text, sizeof uistat.text, "%3d", uistat.value);
break; break;
case KM_10MHZ:
uistat.value = setting_10mhz;
plot_printf(uistat.text, sizeof uistat.text, "%3.6fMHz", uistat.value / 1000000.0);
break;
} }
{ {
@ -1157,5 +1192,12 @@ set_numeric_value(void)
case KM_NOISE: case KM_NOISE:
set_noise(uistat.value); set_noise(uistat.value);
break; break;
case KM_10MHZ:
if (uistat.value < 9000000) {
set_10mhz(setting_10mhz + uistat.value);
} else
set_10mhz(uistat.value);
dirty = true;
break;
} }
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.