Reduced speed of marker jump max

pull/94/head
erikkaashoek 2 years ago
parent 8cee2ccdae
commit f4ec39c241

@ -2903,6 +2903,7 @@ void set_freq_boundaries(void) {
set_jump_freq( MAX_ABOVE_IF_FREQ, (config.harmonic_start?config.harmonic_start:ULTRA_MAX_FREQ), MIN_BELOW_IF_FREQ); set_jump_freq( MAX_ABOVE_IF_FREQ, (config.harmonic_start?config.harmonic_start:ULTRA_MAX_FREQ), MIN_BELOW_IF_FREQ);
} }
#endif #endif
int main(void) int main(void)
{ {
halInit(); halInit();

@ -6217,7 +6217,7 @@ enum {
enum { enum {
TP_SILENT, TPH_SILENT, TP_10MHZ, TP_10MHZEXTRA, TP_30MHZ_SWITCH, TP_30MHZ, TPH_30MHZ, TPH_30MHZ_SWITCH, TP_SILENT, TPH_SILENT, TP_10MHZ, TP_10MHZEXTRA, TP_30MHZ_SWITCH, TP_30MHZ, TPH_30MHZ, TPH_30MHZ_SWITCH,
#ifdef TINYSA4 #ifdef TINYSA4
TP_30MHZ_ULTRA, TP_30MHZ_DIRECT, TP_30MHZ_LNA,TP_SILENT_LNA, TP_15MHZ_LNA TP_30MHZ_ULTRA, TP_30MHZ_DIRECT, TP_30MHZ_LNA,TP_SILENT_LNA, TP_15MHZ_LNA, TP_15MHZ_LNA2
#endif #endif
}; };
@ -6258,7 +6258,7 @@ const test_case_t test_case [] =
TEST_CASE_STRUCT(TC_ABOVE, TP_30MHZ_DIRECT,900, 10, -90, 0, -90), // 6 Direct path with harmonic TEST_CASE_STRUCT(TC_ABOVE, TP_30MHZ_DIRECT,900, 10, -90, 0, -90), // 6 Direct path with harmonic
TEST_CASE_STRUCT(TC_SIGNAL, TP_10MHZEXTRA, 30, 14, CAL_LEVEL, 26, -45), // 7 BPF loss and stop band TEST_CASE_STRUCT(TC_SIGNAL, TP_10MHZEXTRA, 30, 14, CAL_LEVEL, 26, -45), // 7 BPF loss and stop band
TEST_CASE_STRUCT(TC_FLAT, TP_10MHZEXTRA, 30, 14, -28, 9, -60), // 8 BPF pass band flatness TEST_CASE_STRUCT(TC_FLAT, TP_10MHZEXTRA, 30, 14, -28, 9, -60), // 8 BPF pass band flatness
TEST_CASE_STRUCT(TC_BELOW, TP_30MHZ, 880, 1, -95, 0, -100), // 9 LPF cutoff TEST_CASE_STRUCT(TC_BELOW, TP_15MHZ_LNA2, 855, 1, -90, 0, -90), // 9 LPF cutoff
TEST_CASE_STRUCT(TC_SIGNAL, TP_15MHZ_LNA, 30, 5, CAL_LEVEL, 10, -90), // 10 Flatness TEST_CASE_STRUCT(TC_SIGNAL, TP_15MHZ_LNA, 30, 5, CAL_LEVEL, 10, -90), // 10 Flatness
TEST_CASE_STRUCT(TC_SIGNAL, TP_30MHZ_SWITCH,30, 7, CAL_LEVEL, 10, -50), // 11 Switch isolation using high attenuation TEST_CASE_STRUCT(TC_SIGNAL, TP_30MHZ_SWITCH,30, 7, CAL_LEVEL, 10, -50), // 11 Switch isolation using high attenuation
TEST_CASE_STRUCT(TC_DISPLAY, TP_30MHZ, 30, 0, CAL_LEVEL, 50, -60), // 12 test display TEST_CASE_STRUCT(TC_DISPLAY, TP_30MHZ, 30, 0, CAL_LEVEL, 50, -60), // 12 test display
@ -6456,8 +6456,9 @@ int validate_signal_within(int i, float margin)
test_level = lpf_test_level; test_level = lpf_test_level;
margin = 5; margin = 5;
} }
if (fabsf(config.low_level_offset) > 10)
return(TS_FAIL);
#endif #endif
if (fabsf(peakLevel-test_level) > 2*margin) { if (fabsf(peakLevel-test_level) > 2*margin) {
return TS_FAIL; return TS_FAIL;
} }
@ -6707,6 +6708,7 @@ void test_prepare(int i)
setting.tracking = false; //Default test setup setting.tracking = false; //Default test setup
setting.atten_step = false; setting.atten_step = false;
#ifdef TINYSA4 #ifdef TINYSA4
force_signal_path = false;
setting.frequency_IF = config.frequency_IF1; // Default frequency setting.frequency_IF = config.frequency_IF1; // Default frequency
setting.extra_lna = false; setting.extra_lna = false;
#else #else
@ -6794,6 +6796,10 @@ common_silent:
case TP_15MHZ_LNA: case TP_15MHZ_LNA:
determine_lpf_test_level(); determine_lpf_test_level();
goto simple; goto simple;
case TP_15MHZ_LNA2:
force_signal_path = true;
test_path = 1;
goto simple;
case TP_30MHZ_DIRECT: case TP_30MHZ_DIRECT:
case TP_30MHZ_ULTRA: case TP_30MHZ_ULTRA:
case TP_30MHZ_LNA: case TP_30MHZ_LNA:
@ -6838,6 +6844,7 @@ common_silent:
setting.extra_lna = true; setting.extra_lna = true;
break; break;
case TP_15MHZ_LNA: case TP_15MHZ_LNA:
case TP_15MHZ_LNA2:
set_refer_output(1); set_refer_output(1);
setting.extra_lna = true; setting.extra_lna = true;
break; break;
@ -6969,6 +6976,10 @@ void self_test(int test)
#ifdef TINYSA4 #ifdef TINYSA4
bool old_ultra = config.ultra; bool old_ultra = config.ultra;
config.ultra = true; config.ultra = true;
if (adc_vbat_read() < 3800) {
drawMessageBox("Battery low", "Charge before testing", 2000);
goto quit;
}
#endif #endif
// set_sweep_points(POINTS_COUNT); // set_sweep_points(POINTS_COUNT);
if (test == 0) { if (test == 0) {

32
ui.c

@ -43,9 +43,10 @@ uistat_t uistat = {
#define EVT_BUTTON_SINGLE_CLICK 0x01 #define EVT_BUTTON_SINGLE_CLICK 0x01
#define EVT_BUTTON_DOUBLE_CLICK 0x02 #define EVT_BUTTON_DOUBLE_CLICK 0x02
#define EVT_BUTTON_DOWN_LONG 0x04 #define EVT_BUTTON_DOWN_LONG 0x04
#define EVT_UP 0x10 #define EVT_BUTTON_CLICK_RELEASE 0x08
#define EVT_DOWN 0x20 #define EVT_UP 0x10
#define EVT_REPEAT 0x40 #define EVT_DOWN 0x20
#define EVT_REPEAT 0x40
#define BUTTON_DOWN_LONG_TICKS MS2ST(500) // 500ms #define BUTTON_DOWN_LONG_TICKS MS2ST(500) // 500ms
#define BUTTON_DOUBLE_TICKS MS2ST(250) // 250ms #define BUTTON_DOUBLE_TICKS MS2ST(250) // 250ms
@ -7264,18 +7265,25 @@ static void
lever_search_marker(int status) lever_search_marker(int status)
{ {
int i = -1; int i = -1;
int wait_count = 0;
do { do {
if (active_marker != MARKER_INVALID) { if (active_marker != MARKER_INVALID) {
if (status & EVT_DOWN) #define WAIT_COUNT 3
i = marker_search_left_max(active_marker); if (wait_count == 0)
else if (status & EVT_UP) wait_count = WAIT_COUNT;
i = marker_search_right_max(active_marker); if (wait_count == WAIT_COUNT) {
if (i != -1) { if (status & EVT_DOWN)
markers[active_marker].index = i; i = marker_search_left_max(active_marker);
interpolate_maximum(active_marker); else if (status & EVT_UP)
markers[active_marker].mtype &= ~M_TRACKING; i = marker_search_right_max(active_marker);
if (i != -1) {
markers[active_marker].index = i;
interpolate_maximum(active_marker);
markers[active_marker].mtype &= ~M_TRACKING;
}
redraw_marker(active_marker);
} }
redraw_marker(active_marker); wait_count --;
} }
status = btn_wait_release(); status = btn_wait_release();
} while (status != 0); } while (status != 0);

Loading…
Cancel
Save

Powered by TurnKey Linux.