Depth error message added

pull/34/head
erikkaashoek 3 years ago
parent 22b70e507b
commit 600720be51

@ -349,6 +349,7 @@ extern bool ultra;
extern float measured_noise_figure; extern float measured_noise_figure;
extern float *drive_dBm; extern float *drive_dBm;
extern bool level_error; extern bool level_error;
extern bool depth_error;
#else #else
extern const int8_t drive_dBm []; extern const int8_t drive_dBm [];
#endif #endif
@ -1206,7 +1207,7 @@ typedef struct setting
#ifdef __ULTRA__ #ifdef __ULTRA__
uint8_t ultra; // enum ?? uint8_t ultra; // enum ??
#endif #endif
#ifdef TINYSA4 #ifdef TINYSA4
bool extra_lna; bool extra_lna;
int R; // KM_R int R; // KM_R
int32_t exp_aver; int32_t exp_aver;

@ -288,7 +288,8 @@ void set_output_path(freq_t f, float level)
a -= blw; a -= blw;
set_output_drive(d); set_output_drive(d);
// if (signal_path != PATH_LEAKAGE) // if (signal_path != PATH_LEAKAGE)
a -= ATTENUATION_RESERVE; a -= ATTENUATION_RESERVE;
depth_error = false;
if (a > 0) { if (a > 0) {
a = 0; a = 0;
if (!level_error) { level_error = true; redraw_request |= REDRAW_CAL_STATUS; draw_all(true);} if (!level_error) { level_error = true; redraw_request |= REDRAW_CAL_STATUS; draw_all(true);}
@ -541,6 +542,7 @@ void reset_settings(int m)
drive_dBm = (float *) (setting.mode == M_GENHIGH ? adf_drive_dBm : si_drive_dBm); drive_dBm = (float *) (setting.mode == M_GENHIGH ? adf_drive_dBm : si_drive_dBm);
setting.exp_aver = 1; setting.exp_aver = 1;
setting.increased_R = false; setting.increased_R = false;
setting.mixer_output = true;
#endif #endif
update_min_max_freq(); update_min_max_freq();
force_signal_path = false; force_signal_path = false;
@ -602,7 +604,7 @@ void reset_settings(int m)
setting.lna = S_AUTO_OFF; setting.lna = S_AUTO_OFF;
setting.tracking = false; setting.tracking = false;
setting.modulation = MO_NONE; setting.modulation = MO_NONE;
setting.modulation_frequency = 400; setting.modulation_frequency = 1000;
#ifdef TINYSA4 #ifdef TINYSA4
setting.modulation_depth_x100 = 80; // %80 setting.modulation_depth_x100 = 80; // %80
setting.modulation_deviation_div100 = 30; // 3kHz setting.modulation_deviation_div100 = 30; // 3kHz
@ -806,9 +808,7 @@ void set_gridlines(int d)
int set_actual_freq(int f) int set_actual_freq(int f)
{ {
if (get_sweep_frequency(ST_CENTER) > 1000000000) if (f < - 100000 || f > +100000)
return -1;
if (f < - 10000 || f > +10000)
return -1; return -1;
config.setting_frequency_30mhz = 3000000000 + f * 3 ; config.setting_frequency_30mhz = 3000000000 + f * 3 ;
ADF4351_recalculate_PFDRFout(); ADF4351_recalculate_PFDRFout();
@ -3312,6 +3312,7 @@ int test_path = 0;
int test_output_attenuate = 0; int test_output_attenuate = 0;
#ifdef TINYSA4 #ifdef TINYSA4
bool level_error = false; bool level_error = false;
bool depth_error = false;
static float old_temp = 0.0; static float old_temp = 0.0;
#endif #endif
@ -3681,11 +3682,11 @@ modulation_again:
#else #else
int p = setting.attenuate_x2 + am_modulation[modulation_counter]; int p = setting.attenuate_x2 + am_modulation[modulation_counter];
#endif #endif
if (p>63)p = 63; if (p>63) { p = 63;}
else if (p< 0) { else if (p< 0) {
p = 0; p = 0;
#ifdef TINSYA4 #ifdef TINYSA4
if (!level_error) { level_error = true; redraw_request |= REDRAW_CAL_STATUS; draw_all(true);} if (!depth_error) { depth_error = true; redraw_request |= REDRAW_CAL_STATUS; draw_all(true);}
#endif #endif
} }
#ifdef __PE4302__ #ifdef __PE4302__

@ -3929,6 +3929,10 @@ redraw_cal_status:
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED); ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
ili9341_drawstring("LEVEL\nERROR", 0 , 80); ili9341_drawstring("LEVEL\nERROR", 0 , 80);
} }
if (depth_error) {
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
ili9341_drawstring("DEPTH\nERROR", 0 , 140);
}
#endif #endif
return; return;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.