Path repairs

pull/34/head
erikkaashoek 4 years ago
parent 8b7071f850
commit e9fb1e4143

@ -1636,6 +1636,8 @@ float to_dBm(float);
float dBm_to_Watt(float);
uint32_t calc_min_sweep_time_us(void);
pureRSSI_t perform(bool b, int i, freq_t f, int e);
extern pureRSSI_t get_frequency_correction(freq_t f);
void interpolate_maximum(int m);
void calibrate_modulation(int modulation, int8_t *correction);

@ -1165,6 +1165,7 @@ VNA_SHELL_FUNCTION(cmd_q)
test_output_drive = 0;
test_output_attenuate = 0;
test_path = 0;
dirty = true;
return;
}
int i = 0;

@ -196,9 +196,10 @@ void set_output_path(freq_t f, float level)
PE4302_Write_Byte(test_output_attenuate);
goto set_path;
}
} else if (setting.mute)
} else if (setting.mute) {
signal_path = PATH_OFF;
else if (MODE_HIGH(setting.mode))
goto set_path;
} else if (MODE_HIGH(setting.mode))
signal_path = PATH_HIGH;
else if (setting.mixer_output && (f >= MAX_LOW_OUTPUT_FREQ || (config.ultra_start != ULTRA_AUTO && f > config.ultra_start)))
signal_path = PATH_ULTRA;
@ -209,6 +210,8 @@ void set_output_path(freq_t f, float level)
else
signal_path = PATH_LOW;
level += PURE_TO_float(get_frequency_correction(f));
switch (signal_path) {
case PATH_LEAKAGE:
drive_dBm = (float *)adf_drive_dBm;
@ -349,7 +352,9 @@ void set_output_path(freq_t f, float level)
void set_input_path(freq_t f)
{
if (MODE_HIGH(setting.mode))
if (test_output)
signal_path = test_path;
else if (MODE_HIGH(setting.mode))
signal_path = PATH_HIGH;
else if(config.ultra && ((config.ultra_start == ULTRA_AUTO && f > 700) || (config.ultra_start != ULTRA_AUTO && f >config.ultra_start)))
signal_path = PATH_ULTRA;
@ -2098,6 +2103,8 @@ pureRSSI_t get_frequency_correction(freq_t f) // Frequency dependent RSSI c
} else if (setting.mode == M_GENLOW){
switch (signal_path) {
case PATH_OFF:
return 0;
case PATH_LOW:
c = CORRECTION_LOW_OUT;
break;
@ -3346,13 +3353,14 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
else if (ls < 0)
ls -= 0.5;
float a = ((int)((setting.level + ((float)i / sweep_points) * ls)*2.0)) / 2.0 /* + get_level_offset() */ ;
#ifdef TINYSA4
{
set_output_path(f, a);
#else
correct_RSSI_freq = get_frequency_correction(f);
a += PURE_TO_float(correct_RSSI_freq);
if (a != old_a) {
old_a = a;
#ifdef TINYSA4
set_output_path(f, a);
#else
a = a - level_max(); // convert to all settings maximum power output equals a = zero
if (a < -SWITCH_ATTENUATION) {
a = a + SWITCH_ATTENUATION;

@ -1012,13 +1012,21 @@ static UI_FUNCTION_ADV_CALLBACK(menu_listen_acb)
}
#endif
#ifdef TINYSA4
enum {PATH_OFF, PATH_LOW, PATH_DIRECT, PATH_ULTRA, PATH_LEAKAGE, PATH_HIGH};
const char *path_text[]={"OFF", "LOW", "DIRECT", "ULTRA", "ADF", "High"};
extern int signal_path;
extern int test_path;
extern int test_output;
static UI_FUNCTION_ADV_CALLBACK(menu_lowoutput_settings_acb)
{
static char mode_string[26];
(void)item;
if (b){
if (data == 255) {
plot_printf(mode_string, sizeof mode_string, "%s %s %s",
plot_printf(mode_string, sizeof mode_string, "%s %s %s %s",
(!test_output ? "" : path_text[test_path]),
(get_sweep_frequency(ST_START) < MINIMUM_DIRECT_FREQ ? "SINUS" : "" ),
(get_sweep_frequency(ST_STOP) >= MINIMUM_DIRECT_FREQ ? "SQUARE WAVE" : ""),
(get_sweep_frequency(ST_STOP) > MAX_LOW_OUTPUT_FREQ && setting.mixer_output ? "MIXER" : ""));
@ -3334,7 +3342,11 @@ static void fetch_numeric_target(uint8_t mode)
if (setting.level_sweep != 0)
plot_printf(uistat.text, sizeof uistat.text, "%.1f to %.1fdBm", uistat.value, end_level);
else
#ifdef TINYSA4
plot_printf(uistat.text, sizeof uistat.text, "%+.1fdBm %s", uistat.value, (setting.disable_correction?"Uncorrected":""));
#else
plot_printf(uistat.text, sizeof uistat.text, "%+.1fdBm", uistat.value);
#endif
break;
case KM_HIGHOUTLEVEL:
uistat.value = get_level(); // compensation for dB offset during low output mode

Loading…
Cancel
Save

Powered by TurnKey Linux.