|
|
|
@ -619,6 +619,7 @@ void user_set_reflevel(float level)
|
|
|
|
set_reflevel(setting.scale*NGRIDY);
|
|
|
|
set_reflevel(setting.scale*NGRIDY);
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
set_reflevel(level);
|
|
|
|
set_reflevel(level);
|
|
|
|
|
|
|
|
force_set_markmap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void set_reflevel(float level)
|
|
|
|
void set_reflevel(float level)
|
|
|
|
@ -670,6 +671,7 @@ void user_set_scale(float s)
|
|
|
|
set_scale(s);
|
|
|
|
set_scale(s);
|
|
|
|
if (UNIT_IS_LINEAR(setting.unit) && setting.reflevel < setting.scale*NGRIDY)
|
|
|
|
if (UNIT_IS_LINEAR(setting.unit) && setting.reflevel < setting.scale*NGRIDY)
|
|
|
|
set_reflevel(setting.scale*NGRIDY);
|
|
|
|
set_reflevel(setting.scale*NGRIDY);
|
|
|
|
|
|
|
|
force_set_markmap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void set_scale(float t) {
|
|
|
|
void set_scale(float t) {
|
|
|
|
@ -710,6 +712,7 @@ void set_scale(float t) {
|
|
|
|
void set_offset(float offset)
|
|
|
|
void set_offset(float offset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
setting.offset = offset;
|
|
|
|
setting.offset = offset;
|
|
|
|
|
|
|
|
force_set_markmap();
|
|
|
|
dirty = true;
|
|
|
|
dirty = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -1260,7 +1263,7 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking) // M
|
|
|
|
ls += 0.5;
|
|
|
|
ls += 0.5;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ls -= 0.5;
|
|
|
|
ls -= 0.5;
|
|
|
|
float a = ((int)((setting.level + (i / sweep_points) * ls)*2.0)) / 2.0;
|
|
|
|
float a = ((int)((setting.level + ((float)i / sweep_points) * ls)*2.0)) / 2.0;
|
|
|
|
if (a != old_a) {
|
|
|
|
if (a != old_a) {
|
|
|
|
old_a = a;
|
|
|
|
old_a = a;
|
|
|
|
int d = 0; // Start at lowest drive level;
|
|
|
|
int d = 0; // Start at lowest drive level;
|
|
|
|
@ -1576,12 +1579,9 @@ again: // Waiting for a trigger jumps back to here
|
|
|
|
float temp_min_level = 100;
|
|
|
|
float temp_min_level = 100;
|
|
|
|
|
|
|
|
|
|
|
|
// spur_old_stepdelay = 0;
|
|
|
|
// spur_old_stepdelay = 0;
|
|
|
|
int repeats = 1;
|
|
|
|
|
|
|
|
// shell_printf("\r\n");
|
|
|
|
// shell_printf("\r\n");
|
|
|
|
if (MODE_OUTPUT(setting.mode) && setting.modulation != MO_NONE) { // If in output mode
|
|
|
|
|
|
|
|
repeats = 1000; // stay as long as possible in the sweep loop to avoid interrupting the tone during by UI processing
|
|
|
|
modulation_counter = 0; // init modulation counter in case needed
|
|
|
|
modulation_counter = 0; // init modulation counter
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t t = calc_min_sweep_time_us(); // Time to delay in uS
|
|
|
|
uint32_t t = calc_min_sweep_time_us(); // Time to delay in uS
|
|
|
|
if (t < setting.sweep_time_us){
|
|
|
|
if (t < setting.sweep_time_us){
|
|
|
|
@ -1591,14 +1591,14 @@ again: // Waiting for a trigger jumps back to here
|
|
|
|
else
|
|
|
|
else
|
|
|
|
t = 0;
|
|
|
|
t = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (MODE_OUTPUT(setting.mode) && t < 500) // Minimum wait time to prevent LO from lockup
|
|
|
|
if (MODE_OUTPUT(setting.mode) && t < 500) // Minimum wait time to prevent LO from lockup during output frequency sweep
|
|
|
|
t = 500;
|
|
|
|
t = 500;
|
|
|
|
|
|
|
|
|
|
|
|
set_freq_time = 0; // for predicting the weep time
|
|
|
|
set_freq_time = 0; // for predicting the weep time
|
|
|
|
|
|
|
|
|
|
|
|
while (repeats--) {
|
|
|
|
sweep_again: // stay in sweep loop when output mode and modulation on.
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------- sweep loop -----------------------------------
|
|
|
|
// ------------------------- start sweep loop -----------------------------------
|
|
|
|
// START_PROFILE;
|
|
|
|
// START_PROFILE;
|
|
|
|
for (int i = 0; i < sweep_points; i++) {
|
|
|
|
for (int i = 0; i < sweep_points; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
@ -1618,8 +1618,8 @@ again: // Waiting for a trigger jumps back to here
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------- delay between points if needed ----------------
|
|
|
|
// ----------------- delay between points if needed ----------------
|
|
|
|
|
|
|
|
|
|
|
|
if (t && (MODE_INPUT(setting.mode) || setting.modulation == MO_NONE)) {
|
|
|
|
if (t && (MODE_INPUT(setting.mode) || setting.modulation == MO_NONE)) { // No delay when modulation is active
|
|
|
|
if (t < 30*ONE_MS_TIME)
|
|
|
|
if (t < 30*ONE_MS_TIME) // Maximum delay time using my_microsecond_delay
|
|
|
|
my_microsecond_delay(t);
|
|
|
|
my_microsecond_delay(t);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
osalThreadSleepMilliseconds(t / ONE_MS_TIME);
|
|
|
|
osalThreadSleepMilliseconds(t / ONE_MS_TIME);
|
|
|
|
@ -1633,18 +1633,14 @@ again: // Waiting for a trigger jumps back to here
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (MODE_OUTPUT(setting.mode)) { // if in output mode
|
|
|
|
if (MODE_INPUT(setting.mode)) {
|
|
|
|
continue; // Skip all other processing in sweep loop
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MODE_INPUT(setting.mode)) { // this is always true I guess......
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (setting.actual_sweep_time_us > ONE_SECOND_TIME && (i & 0x07) == 0) { // if required
|
|
|
|
if (setting.actual_sweep_time_us > ONE_SECOND_TIME && (i & 0x07) == 0) { // if required
|
|
|
|
ili9341_fill(OFFSETX, HEIGHT_NOSCROLL+1, i, 1, BRIGHT_COLOR_GREEN); // update sweep progress bar
|
|
|
|
ili9341_fill(OFFSETX, HEIGHT_NOSCROLL+1, i, 1, BRIGHT_COLOR_GREEN); // update sweep progress bar
|
|
|
|
ili9341_fill(OFFSETX+i, HEIGHT_NOSCROLL+1, WIDTH-i, 1, 0);
|
|
|
|
ili9341_fill(OFFSETX+i, HEIGHT_NOSCROLL+1, WIDTH-i, 1, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------ do all RSSI calculations frm CALC menu -------------------
|
|
|
|
// ------------------------ do all RSSI calculations from CALC menu -------------------
|
|
|
|
|
|
|
|
|
|
|
|
if (setting.average != AV_OFF)
|
|
|
|
if (setting.average != AV_OFF)
|
|
|
|
temp_t[i] = RSSI;
|
|
|
|
temp_t[i] = RSSI;
|
|
|
|
@ -1675,6 +1671,9 @@ again: // Waiting for a trigger jumps back to here
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (temp_min_level > actual_t[i]) // Remember minimum
|
|
|
|
|
|
|
|
temp_min_level = actual_t[i];
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------- find peak and add to peak table if found ------------------------
|
|
|
|
// --------------------------- find peak and add to peak table if found ------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1725,14 +1724,14 @@ again: // Waiting for a trigger jumps back to here
|
|
|
|
|
|
|
|
|
|
|
|
downslope = true;
|
|
|
|
downslope = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // end of peak finding
|
|
|
|
} // end of peak finding
|
|
|
|
|
|
|
|
} // end of input specific processing
|
|
|
|
|
|
|
|
} // ---------------------- end of sweep loop -----------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MODE_OUTPUT(setting.mode) && setting.modulation != MO_NONE) // if in output mode with modulation
|
|
|
|
|
|
|
|
goto sweep_again; // Keep repeating sweep loop till user aborts by input
|
|
|
|
|
|
|
|
|
|
|
|
if (temp_min_level > actual_t[i]) // Remember minimum
|
|
|
|
|
|
|
|
temp_min_level = actual_t[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// STOP_PROFILE;
|
|
|
|
// STOP_PROFILE;
|
|
|
|
// --------------- check if maximum is above trigger level -----------------
|
|
|
|
// --------------- check if maximum is above trigger level -----------------
|
|
|
|
|
|
|
|
|
|
|
|
@ -1926,7 +1925,8 @@ again: // Waiting for a trigger jumps back to here
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
min_level = temp_min_level;
|
|
|
|
min_level = temp_min_level;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// } while (MODE_OUTPUT(setting.mode) && setting.modulation != MO_NONE); // Never exit sweep loop while in output mode with modulation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//---------------- in Linearity measurement the attenuation has to be adapted ------------------
|
|
|
|
//---------------- in Linearity measurement the attenuation has to be adapted ------------------
|
|
|
|
|