Repaired harmonic jump

pull/34/head
erikkaashoek 3 years ago
parent 9f667bbfcc
commit 53ffa5c7c5

@ -5917,6 +5917,8 @@ const test_case_t test_case [] =
TEST_CASE_STRUCT(TC_MEASURE, TP_SILENT, 201, 1, -166, 10, -166), // 16 Measure RBW step time TEST_CASE_STRUCT(TC_MEASURE, TP_SILENT, 201, 1, -166, 10, -166), // 16 Measure RBW step time
#define TEST_JUMP 29 #define TEST_JUMP 29
TEST_CASE_STRUCT(TC_JUMP, TP_30MHZ_LNA, 30, 0.001, -40, 0, CAL_LEVEL), // 16 Measure jumps TEST_CASE_STRUCT(TC_JUMP, TP_30MHZ_LNA, 30, 0.001, -40, 0, CAL_LEVEL), // 16 Measure jumps
#define TEST_JUMP_HARMONIC 30
TEST_CASE_STRUCT(TC_JUMP, TP_30MHZ, 30, 0.001, -40, 0, CAL_LEVEL), // 16 Measure jumps
}; };
#else #else
{// Condition Preparation Center Span Pass Width(%)Stop {// Condition Preparation Center Span Pass Width(%)Stop
@ -5991,6 +5993,7 @@ static void test_acquire(int i)
TRACE_ENABLE(TRACE_STORED_FLAG); TRACE_ENABLE(TRACE_STORED_FLAG);
plot_into_index(measured); plot_into_index(measured);
redraw_request |= REDRAW_CELLS | REDRAW_FREQUENCY; redraw_request |= REDRAW_CELLS | REDRAW_FREQUENCY;
// draw_all(TRUE);
} }
int cell_printf(int16_t x, int16_t y, const char *fmt, ...); int cell_printf(int16_t x, int16_t y, const char *fmt, ...);
@ -7264,16 +7267,21 @@ void calibrate_harmonic(void)
{ {
test_freq = jump_freqs[i]; test_freq = jump_freqs[i];
set_jump_config(i, -2); set_jump_config(i, -2);
test_prepare(TEST_JUMP); test_prepare(TEST_JUMP_HARMONIC);
set_RBW(1000); set_RBW(1000);
// set_auto_reflevel(true); // set_auto_reflevel(true);
set_reflevel(-20); set_reflevel(-20);
setting.repeat = 10; setting.repeat = 10;
test_acquire(TEST_JUMP); // Acquire test test_acquire(TEST_JUMP_HARMONIC); // Acquire test
if (peakLevel < -50) {
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
ili9341_drawstring_7x13("Signal level too low", 30, 200);
goto quit;
}
set_jump_config(i, get_jump_config(i) + measure_jump(i)); set_jump_config(i, get_jump_config(i) + measure_jump(i));
calibration_busy(); calibration_busy();
chThdSleepMilliseconds(500); chThdSleepMilliseconds(500);
test_acquire(TEST_JUMP); // Acquire test test_acquire(TEST_JUMP_HARMONIC); // Acquire test
set_jump_config(i, get_jump_config(i) + measure_jump(i)); set_jump_config(i, get_jump_config(i) + measure_jump(i));
calibration_busy(); calibration_busy();
chThdSleepMilliseconds(500); chThdSleepMilliseconds(500);
@ -7285,6 +7293,7 @@ void calibrate_harmonic(void)
config_save(); config_save();
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN); ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
ili9341_drawstring_7x13("Calibration complete", 40, 200); ili9341_drawstring_7x13("Calibration complete", 40, 200);
quit:
ili9341_drawstring_7x13("Touch screen to continue", 40, 220); ili9341_drawstring_7x13("Touch screen to continue", 40, 220);
wait_user(); wait_user();
ili9341_clear_screen(); ili9341_clear_screen();

@ -927,7 +927,8 @@ static UI_FUNCTION_CALLBACK(menu_scale_cb)
static UI_FUNCTION_CALLBACK(menu_calibrate_cb) static UI_FUNCTION_CALLBACK(menu_calibrate_cb)
{ {
(void)data; (void)data;
switch (item) { (void)item;
switch (data) {
case 1: case 1:
sweep_mode = SWEEP_CALIBRATE; sweep_mode = SWEEP_CALIBRATE;
menu_move_back(true); menu_move_back(true);
@ -938,6 +939,7 @@ static UI_FUNCTION_CALLBACK(menu_calibrate_cb)
#ifdef TINYSA4 #ifdef TINYSA4
case 3: case 3:
sweep_mode = SWEEP_CALIBRATE_HARMONIC; sweep_mode = SWEEP_CALIBRATE_HARMONIC;
menu_move_back(false);
menu_move_back(true); menu_move_back(true);
break; break;
#endif #endif
@ -3089,7 +3091,7 @@ static const menuitem_t menu_calibrate_harmonic[] =
{ {
{ MT_FORM | MT_TITLE, 0, "Connect 5.34GHz at -50 to -10dBm", NULL}, { MT_FORM | MT_TITLE, 0, "Connect 5.34GHz at -50 to -10dBm", NULL},
#ifdef TINYSA4 #ifdef TINYSA4
{ MT_FORM | MT_CALLBACK, 0, "CALIBRATE", menu_calibrate_cb}, { MT_FORM | MT_CALLBACK, 3, "CALIBRATE", menu_calibrate_cb},
#endif #endif
{ MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
}; };
@ -3098,8 +3100,8 @@ static const menuitem_t menu_calibrate_harmonic[] =
static const menuitem_t menu_calibrate[] = static const menuitem_t menu_calibrate[] =
{ {
{ MT_FORM | MT_TITLE, 0, "Connect HIGH and LOW", NULL}, { MT_FORM | MT_TITLE, 0, "Connect HIGH and LOW", NULL},
{ MT_FORM | MT_CALLBACK, 0, "CALIBRATE", menu_calibrate_cb}, { MT_FORM | MT_CALLBACK, 1, "CALIBRATE", menu_calibrate_cb},
{ MT_FORM | MT_CALLBACK, 0, "RESET CALIBRATION", menu_calibrate_cb}, { MT_FORM | MT_CALLBACK, 2, "RESET CALIBRATION", menu_calibrate_cb},
#ifdef TINYSA4 #ifdef TINYSA4
{ MT_FORM | MT_SUBMENU, 0, "CALIBRATE HARMONIC", menu_calibrate_harmonic}, { MT_FORM | MT_SUBMENU, 0, "CALIBRATE HARMONIC", menu_calibrate_harmonic},
#endif #endif

Loading…
Cancel
Save

Powered by TurnKey Linux.