Small changes

SI443_RBW_update
erikkaashoek 4 years ago
parent 8ecd720a0c
commit 16db0c3336

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1383655154117049" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1470119594931406" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@ -17,7 +17,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1383655154117049" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1470119594931406" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

@ -971,7 +971,7 @@ config_t config = {
.vbat_offset = 220,
.frequency_IF1 = DEFAULT_IF,
.frequency_IF2 = 0,
.ultra_threshold = 0,
.ultra_threshold = ULTRA_AUTO,
.low_level_offset = 100.0, // Uncalibrated
.high_level_offset = 100, // Uncalibrated
.lna_level_offset = 100,
@ -983,14 +983,33 @@ config_t config = {
{ 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low lna
{ 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low ultra in
{ 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low ultra lna
#ifdef DIRECT_CORRECTION
{ 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low ultra in
{ 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low ultra lna
#endif
{ 10000, 50000, 80000, 150000, 300000, 1000000, 5000000, 30000000, 100000000, 180000000, 650000000, 700000000, 760000000, 780000000, 790000000, 800000000, 800000000, 800000000, 800000000, 800000000}, // low out
},
.correction_value =
{
#if 1
{ 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // low in
{ 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // low in
{ 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // low in
{ 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // low in
#ifdef DIRECT_CORRECTION
{ 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // low in
{ 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // low in
#endif
#else
{ 10.5, +3, +1 , -0.1, 0, 0, +1.1, +1.5, +1.8, +9.7, +3.8, +3.5, +4, +8, +10.5, +13, +17.5, +20, +24, +28,}, // low in
{ 10.5, +3, +1 , -0.1, 0, 0, +1.1, +1.5, +1.8, +9.7, +3.8, +3.5, +4, +8, +10.5, +13, +17.5, +20, +24, +28,}, // lna in
{ 10.5, +3, +1 , -0.1, 0, 0, +1.1, +1.5, +1.8, +3.7, +3.8, +3.5, +4, +8, +10.5, +13, +17.5, +20, +24, +28,}, // low ultra in
{ 10.5, +3, +1 , -0.1, 0, 0, +1.1, +1.5, +1.8, +3.7, +3.8, +3.5, +4, +8, +10.5, +13, +17.5, +20, +24, +28,}, // lna ultra in
#ifdef DIRECT_CORRECTION
{ 10.5, +3, +1 , -0.1, 0, 0, +1.1, +1.5, +1.8, +9.7, +3.8, +3.5, +4, +8, +10.5, +13, +17.5, +20, +24, +28,}, // low in
{ 10.5, +3, +1 , -0.1, 0, 0, +1.1, +1.5, +1.8, +9.7, +3.8, +3.5, +4, +8, +10.5, +13, +17.5, +20, +24, +28,}, // lna in
#endif
#endif
{ 11.5, 7, 6, 3.5, 1.5, 0.5, -0.2, 0, 0, -0.5, +1.5, +2, +4, +6.5, +9, +13, +13, +13, +13, +13, }, // low out
},
.setting_frequency_30mhz = 30000000ULL * FREQ_MULTIPLIER,
@ -2016,6 +2035,7 @@ static const VNAShellCommand commands[] =
#endif
#ifdef TINYSA4
{ "lna", cmd_lna, CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD },
{ "direct", cmd_direct, CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD },
#endif
#ifdef __ULTRA__
{ "ultra", cmd_ultra, CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD },

@ -93,6 +93,7 @@
#define __NOISE_FIGURE__
#define __VBW__
#define __SWEEP_RESTART__
// #define DIRECT_CORRECTION // Not enough space for config in one flash page.
#define DB_PER_DEGREE_BELOW 0.056
#define DB_PER_DEGREE_ABOVE 0.069
#define CENTER_TEMPERATURE 34.0
@ -135,6 +136,7 @@
#define HIGH_MAX_FREQ_MHZ 1130
#define MINIMUM_DIRECT_FREQ 830000000ULL
#define ULTRA_MAX_FREQ 5350000000ULL
#define ULTRA_AUTO 10000000000ULL // 10GHz
//#define ULTRA_MAX_FREQ 2900000000ULL
#define MAX_LO_FREQ 4350000000ULL
//#define LOW_MAX_FREQ 800000000ULL
@ -199,10 +201,18 @@ typedef uint32_t freq_t;
#define CORRECTION_LNA 1
#define CORRECTION_LOW_ULTRA 2
#define CORRECTION_LNA_ULTRA 3
#ifdef DIRECT_CORRECTION
#define CORRECTION_DIRECT 4
#define CORRECTION_LNA_DIRECT 5
#define CORRECTION_LOW_OUT 6
#define CORRECTION_HIGH 7
#define CORRECTION_SIZE 8
#else
#define CORRECTION_LOW_OUT 4
#define CORRECTION_HIGH 5
#define CORRECTION_SIZE 6
#endif
#endif
typedef float measurement_t[TRACES_MAX][POINTS_COUNT];
extern measurement_t measured;
#endif
@ -433,6 +443,8 @@ extern float high_out_offset(void);
#define LOW_OUT_OFFSET low_out_offset()
#define HIGH_OUT_OFFSET high_out_offset()
extern bool debug_avoid;
extern bool progress_bar;
extern void toggle_debug_avoid(void);
extern float log_averaging_correction;
#else

@ -465,6 +465,33 @@ VNA_SHELL_FUNCTION(cmd_ultra_start)
#endif
#ifdef TINYSA4
VNA_SHELL_FUNCTION(cmd_direct)
{
if (argv[0][0] == '?')
goto usage;
freq_t value = 0;
if (argc == 2) value = my_atoui(argv[1]);
// Parse direct {start|stop} {freq(Hz)}
static const char direct_cmd[] = "start|stop|on|off";
int type = get_str_index(argv[0], direct_cmd);
switch(type) {
case 0:
config.direct_start = value;
return;
case 1:
config.direct_stop = value;
return;
case 2:
config.direct = true;
return;
case 3:
config.direct = false;
return;
}
usage:
usage_printf("direct {%s} {freq(Hz)}\r\n", direct_cmd);
}
VNA_SHELL_FUNCTION(cmd_if1)
{
if (argc != 1 || argv[0][0] == '?') {

@ -50,6 +50,7 @@ float *imag = (float *) &spi_buffer[512];
uint8_t scandirty = true;
bool debug_avoid = false;
bool debug_avoid_second = false;
bool progress_bar = true;
#ifdef __ULTRA__
bool debug_spur = false;
#endif
@ -232,7 +233,7 @@ void reset_settings(int m)
setting.mode = m;
setting.sweep = false;
#ifdef __ULTRA__
ultra_threshold = (config.ultra_threshold == 0 ? DEFAULT_ULTRA_THRESHOLD : config.ultra_threshold);
ultra_threshold = (config.ultra_threshold == ULTRA_AUTO ? DEFAULT_ULTRA_THRESHOLD : config.ultra_threshold);
ultra = config.ultra;
#endif
#ifdef TINYSA4
@ -4254,7 +4255,7 @@ static bool sweep(bool break_on_operation)
float temp_min_level = 100; // Initialize the peak search algorithm
int16_t downslope = true;
#ifdef __ULTRA__
if (setting.mode == M_LOW && config.ultra_threshold == 0) {
if (setting.mode == M_LOW && config.ultra_threshold == ULTRA_AUTO) {
if (getFrequency(sweep_points-1) <= 800000000)
ultra_threshold = 800000000;
else
@ -4285,7 +4286,11 @@ static bool sweep(bool break_on_operation)
#endif
) { // break loop if needed
abort:
if (setting.actual_sweep_time_us > ONE_SECOND_TIME /* && MODE_INPUT(setting.mode) */) {
if (
#ifdef TINYSA4
progress_bar &&
#endif
setting.actual_sweep_time_us > ONE_SECOND_TIME /* && MODE_INPUT(setting.mode) */) {
ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(OFFSETX, CHART_BOTTOM+1, WIDTH, 1); // Erase progress bar
#ifdef __SWEEP_RESTART__
@ -4339,7 +4344,11 @@ static bool sweep(bool break_on_operation)
systime_t local_sweep_time = sa_ST2US(chVTGetSystemTimeX() - start_of_sweep_timestamp);
if (setting.actual_sweep_time_us > ONE_SECOND_TIME)
local_sweep_time = setting.actual_sweep_time_us;
if (show_bar && (( local_sweep_time > ONE_SECOND_TIME && (i & 0x07) == 0) /* || ( local_sweep_time > ONE_SECOND_TIME*10)*/ ) )
if (
#ifdef TINYSA4
progress_bar &&
#endif
show_bar && (( local_sweep_time > ONE_SECOND_TIME && (i & 0x07) == 0) /* || ( local_sweep_time > ONE_SECOND_TIME*10)*/ ) )
{
int pos = i * (WIDTH+1) / sweep_points;
ili9341_set_background(LCD_SWEEP_LINE_COLOR);
@ -6173,7 +6182,7 @@ quit:
if (setting.test_argument)
set_sweep_frequency(ST_CENTER, ((freq_t)setting.test_argument));
#ifdef __ULTRA__
ultra_threshold = (config.ultra_threshold == 0 ? DEFAULT_ULTRA_THRESHOLD : config.ultra_threshold);
ultra_threshold = (config.ultra_threshold == ULTRA_AUTO ? DEFAULT_ULTRA_THRESHOLD : config.ultra_threshold);
#endif
test_acquire(TEST_LEVEL); // Acquire test
test_validate(TEST_LEVEL); // Validate test

@ -1176,6 +1176,19 @@ static UI_FUNCTION_ADV_CALLBACK(menu_debug_spur_acb)
#endif
#ifdef TINYSA4
static UI_FUNCTION_ADV_CALLBACK(menu_progress_bar_acb)
{
(void)data;
(void)item;
if (b){
b->icon = progress_bar == 0 ? BUTTON_ICON_NOCHECK : BUTTON_ICON_CHECK;
return;
}
progress_bar = !progress_bar;
// menu_move_back();
ui_mode_normal();
}
static UI_FUNCTION_ADV_CALLBACK(menu_extra_lna_acb)
{
(void)data;
@ -2720,7 +2733,7 @@ static const menuitem_t menu_settings3[] =
// { MT_KEYPAD, KM_GRIDLINES, "MINIMUM\nGRIDLINES", "Enter minimum horizontal grid divisions"},
{ MT_ADV_CALLBACK, 0, "ADF OUT", menu_adf_out_acb},
{ MT_ADV_CALLBACK, 0, "ENABLE\nULTRA", menu_ultra_acb},
{ MT_KEYPAD, KM_ULTRA_START,"ULTRASTART\n\b%s", "0=auto"},
{ MT_KEYPAD, KM_ULTRA_START,"ULTRASTART\n\b%s", "10G=auto"},
{ MT_ADV_CALLBACK, 0, "ENABLE\nDIRECT", menu_direct_acb},
// { MT_KEYPAD | MT_LOW, KM_IF2, "IF2 FREQ", "Set to zero for no IF2"},
{ MT_KEYPAD, KM_R, "R\n\b%s", "Set R"},
@ -2763,6 +2776,7 @@ static const menuitem_t menu_settings4[] =
{ MT_ADV_CALLBACK, 0, "DEBUG\nFREQ", menu_debug_freq_acb},
{ MT_ADV_CALLBACK, 0, "DEBUG\nAVOID", menu_debug_avoid_acb},
{ MT_ADV_CALLBACK, 0, "DEBUG\nSPUR", menu_debug_spur_acb},
{ MT_ADV_CALLBACK, 0, "PROGRESS\nBAR", menu_progress_bar_acb},
#if 0 // only used during development
{ MT_KEYPAD, KM_COR_AM, "COR\nAM", "Enter AM modulation correction"},
{ MT_KEYPAD, KM_COR_WFM, "COR\nWFM", "Enter WFM modulation correction"},
@ -3471,17 +3485,17 @@ set_numeric_value(void)
#endif
#ifdef __ULTRA__
case KM_ULTRA_START:
config.ultra_threshold = uistat.value;
config.ultra_threshold = uistat.freq_value;
reset_settings(setting.mode);
// config_save(); // TODO not now
//ultra_threshold = config.ultra_threshold;
break;
case KM_DIRECT_START:
config.direct_start = uistat.value;
config.direct_start = uistat.freq_value;
config_save();
break;
case KM_DIRECT_STOP:
config.direct_stop = uistat.value;
config.direct_stop = uistat.freq_value;
config_save();
break;
#endif

Loading…
Cancel
Save

Powered by TurnKey Linux.