|
|
|
@ -1409,7 +1409,7 @@ int binary_search_frequency(int f) // Search which index in the frequency t
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t interpolate_maximum(int m)
|
|
|
|
void interpolate_maximum(int m)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const int idx = markers[m].index;
|
|
|
|
const int idx = markers[m].index;
|
|
|
|
markers[m].frequency = frequencies[idx];
|
|
|
|
markers[m].frequency = frequencies[idx];
|
|
|
|
@ -1746,7 +1746,7 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking)
|
|
|
|
if (i == 0 || setting.frequency_step != 0)
|
|
|
|
if (i == 0 || setting.frequency_step != 0)
|
|
|
|
correct_RSSI_freq = get_frequency_correction(f);
|
|
|
|
correct_RSSI_freq = get_frequency_correction(f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int *current_fm_modulation;
|
|
|
|
int *current_fm_modulation = 0;
|
|
|
|
if (MODE_OUTPUT(setting.mode)) {
|
|
|
|
if (MODE_OUTPUT(setting.mode)) {
|
|
|
|
if (setting.modulation != MO_NONE && setting.modulation != MO_EXTERNAL && setting.modulation_frequency != 0) {
|
|
|
|
if (setting.modulation != MO_NONE && setting.modulation != MO_EXTERNAL && setting.modulation_frequency != 0) {
|
|
|
|
modulation_delay = (1000000/ MODULATION_STEPS ) / setting.modulation_frequency; // 5 steps so 1MHz/5
|
|
|
|
modulation_delay = (1000000/ MODULATION_STEPS ) / setting.modulation_frequency; // 5 steps so 1MHz/5
|
|
|
|
@ -1780,7 +1780,7 @@ modulation_again:
|
|
|
|
PE4302_Write_Byte(p);
|
|
|
|
PE4302_Write_Byte(p);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (setting.modulation == MO_NFM || setting.modulation == MO_WFM ) { //FM modulation
|
|
|
|
else if (current_fm_modulation) { // setting.modulation == MO_NFM || setting.modulation == MO_WFM //FM modulation
|
|
|
|
#ifdef __SI4432__
|
|
|
|
#ifdef __SI4432__
|
|
|
|
SI4432_Sel = SI4432_LO ;
|
|
|
|
SI4432_Sel = SI4432_LO ;
|
|
|
|
int offset = current_fm_modulation[modulation_counter];
|
|
|
|
int offset = current_fm_modulation[modulation_counter];
|
|
|
|
@ -2176,7 +2176,8 @@ sweep_again: // stay in sweep loop when output mo
|
|
|
|
scandirty = false;
|
|
|
|
scandirty = false;
|
|
|
|
if (break_on_operation && operation_requested) { // break loop if needed
|
|
|
|
if (break_on_operation && operation_requested) { // break loop if needed
|
|
|
|
if (setting.actual_sweep_time_us > ONE_SECOND_TIME && MODE_INPUT(setting.mode)) {
|
|
|
|
if (setting.actual_sweep_time_us > ONE_SECOND_TIME && MODE_INPUT(setting.mode)) {
|
|
|
|
ili9341_fill(OFFSETX, CHART_BOTTOM+1, WIDTH, 1, 0); // Erase progress bar
|
|
|
|
ili9341_set_background(LCD_BG_COLOR);
|
|
|
|
|
|
|
|
ili9341_fill(OFFSETX, CHART_BOTTOM+1, WIDTH, 1); // Erase progress bar
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2216,8 +2217,10 @@ sweep_again: // stay in sweep loop when output mo
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
int pos = i * (WIDTH+1) / sweep_points;
|
|
|
|
int pos = i * (WIDTH+1) / sweep_points;
|
|
|
|
ili9341_fill(OFFSETX, CHART_BOTTOM+1, pos, 1, BRIGHT_COLOR_GREEN); // update sweep progress bar
|
|
|
|
ili9341_set_background(LCD_SWEEP_LINE_COLOR);
|
|
|
|
ili9341_fill(OFFSETX+pos, CHART_BOTTOM+1, WIDTH-pos, 1, 0);
|
|
|
|
ili9341_fill(OFFSETX, CHART_BOTTOM+1, pos, 1); // update sweep progress bar
|
|
|
|
|
|
|
|
ili9341_set_background(LCD_BG_COLOR);
|
|
|
|
|
|
|
|
ili9341_fill(OFFSETX+pos, CHART_BOTTOM+1, WIDTH-pos, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------ do all RSSI calculations from CALC menu -------------------
|
|
|
|
// ------------------------ do all RSSI calculations from CALC menu -------------------
|
|
|
|
@ -2338,7 +2341,11 @@ sweep_again: // stay in sweep loop when output mo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// scandirty = true; // To show trigger happened
|
|
|
|
// scandirty = true; // To show trigger happened
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (setting.actual_sweep_time_us > ONE_SECOND_TIME && MODE_INPUT(setting.mode)) {
|
|
|
|
|
|
|
|
// ili9341_fill(OFFSETX, CHART_BOTTOM+1, WIDTH, 1, 0); // Erase progress bar before updating actual_sweep_time
|
|
|
|
|
|
|
|
ili9341_set_background(LCD_BG_COLOR);
|
|
|
|
|
|
|
|
ili9341_fill(OFFSETX, CHART_BOTTOM+1, WIDTH, 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
// ---------------------- process measured actual sweep time -----------------
|
|
|
|
// ---------------------- process measured actual sweep time -----------------
|
|
|
|
// For CW mode value calculated in SI4432_Fill
|
|
|
|
// For CW mode value calculated in SI4432_Fill
|
|
|
|
if (setting.measure_sweep_time_us == 0)
|
|
|
|
if (setting.measure_sweep_time_us == 0)
|
|
|
|
@ -2723,7 +2730,6 @@ sweep_again: // stay in sweep loop when output mo
|
|
|
|
|
|
|
|
|
|
|
|
// redraw_marker(peak_marker, FALSE);
|
|
|
|
// redraw_marker(peak_marker, FALSE);
|
|
|
|
// STOP_PROFILE;
|
|
|
|
// STOP_PROFILE;
|
|
|
|
ili9341_fill(OFFSETX, CHART_BOTTOM+1, WIDTH, 1, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
palSetPad(GPIOC, GPIOC_LED);
|
|
|
|
palSetPad(GPIOC, GPIOC_LED);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
@ -2917,8 +2923,8 @@ void draw_cal_status(void)
|
|
|
|
if (!UNIT_IS_LINEAR(setting.unit))
|
|
|
|
if (!UNIT_IS_LINEAR(setting.unit))
|
|
|
|
rounding = true;
|
|
|
|
rounding = true;
|
|
|
|
const char * const unit = unit_string[setting.unit];
|
|
|
|
const char * const unit = unit_string[setting.unit];
|
|
|
|
|
|
|
|
ili9341_set_background(LCD_BG_COLOR);
|
|
|
|
ili9341_fill(0, 0, OFFSETX, CHART_BOTTOM, 0x0000);
|
|
|
|
ili9341_fill(0, 0, OFFSETX, CHART_BOTTOM);
|
|
|
|
if (MODE_OUTPUT(setting.mode)) { // No cal status during output
|
|
|
|
if (MODE_OUTPUT(setting.mode)) { // No cal status during output
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2926,7 +2932,7 @@ void draw_cal_status(void)
|
|
|
|
// if (current_menu_is_form() && !in_selftest)
|
|
|
|
// if (current_menu_is_form() && !in_selftest)
|
|
|
|
// return;
|
|
|
|
// return;
|
|
|
|
|
|
|
|
|
|
|
|
ili9341_set_background(DEFAULT_BG_COLOR);
|
|
|
|
ili9341_set_background(LCD_BG_COLOR);
|
|
|
|
|
|
|
|
|
|
|
|
float yMax = setting.reflevel;
|
|
|
|
float yMax = setting.reflevel;
|
|
|
|
// Top level
|
|
|
|
// Top level
|
|
|
|
@ -2935,20 +2941,16 @@ void draw_cal_status(void)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
plot_printf(buf, BLEN, "%+4.3F", (yMax/setting.unit_scale));
|
|
|
|
plot_printf(buf, BLEN, "%+4.3F", (yMax/setting.unit_scale));
|
|
|
|
|
|
|
|
|
|
|
|
if (level_is_calibrated()) {
|
|
|
|
if (level_is_calibrated())
|
|
|
|
if (setting.auto_reflevel)
|
|
|
|
color = setting.auto_reflevel ? LCD_FG_COLOR : LCD_BRIGHT_COLOR_GREEN;
|
|
|
|
color = DEFAULT_FG_COLOR;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
color = BRIGHT_COLOR_GREEN;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
color = BRIGHT_COLOR_RED;
|
|
|
|
color = LCD_BRIGHT_COLOR_RED;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
|
|
|
|
|
|
|
|
// Unit
|
|
|
|
// Unit
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
color = DEFAULT_FG_COLOR;
|
|
|
|
color = LCD_FG_COLOR;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
if (setting.auto_reflevel){
|
|
|
|
if (setting.auto_reflevel){
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
@ -2960,7 +2962,7 @@ void draw_cal_status(void)
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
|
|
|
|
|
|
|
|
// Scale
|
|
|
|
// Scale
|
|
|
|
color = DEFAULT_FG_COLOR;
|
|
|
|
color = LCD_FG_COLOR;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
y += YSTEP + YSTEP/2;
|
|
|
|
y += YSTEP + YSTEP/2;
|
|
|
|
#if 1
|
|
|
|
#if 1
|
|
|
|
@ -2979,20 +2981,20 @@ void draw_cal_status(void)
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
|
|
|
|
|
|
|
|
if (is_paused()) {
|
|
|
|
if (is_paused()) {
|
|
|
|
color = BRIGHT_COLOR_GREEN;
|
|
|
|
color = LCD_BRIGHT_COLOR_GREEN;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("PAUSED", x, y);
|
|
|
|
ili9341_drawstring("PAUSED", x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (setting.trigger == T_SINGLE || setting.trigger == T_NORMAL ) {
|
|
|
|
if (setting.trigger == T_SINGLE || setting.trigger == T_NORMAL ) {
|
|
|
|
color = BRIGHT_COLOR_GREEN;
|
|
|
|
color = LCD_BRIGHT_COLOR_GREEN;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("ARMED", x, y);
|
|
|
|
ili9341_drawstring("ARMED", x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (signal_is_AM) {
|
|
|
|
if (signal_is_AM) {
|
|
|
|
color = BRIGHT_COLOR_RED;
|
|
|
|
color = LCD_BRIGHT_COLOR_RED;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("AM", x, y);
|
|
|
|
ili9341_drawstring("AM", x, y);
|
|
|
|
@ -3001,9 +3003,9 @@ void draw_cal_status(void)
|
|
|
|
// if (setting.mode == M_LOW) {
|
|
|
|
// if (setting.mode == M_LOW) {
|
|
|
|
// Attenuation
|
|
|
|
// Attenuation
|
|
|
|
if (setting.auto_attenuation)
|
|
|
|
if (setting.auto_attenuation)
|
|
|
|
color = DEFAULT_FG_COLOR;
|
|
|
|
color = LCD_FG_COLOR;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
color = BRIGHT_COLOR_GREEN;
|
|
|
|
color = LCD_BRIGHT_COLOR_GREEN;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("Atten:", x, y);
|
|
|
|
ili9341_drawstring("Atten:", x, y);
|
|
|
|
@ -3014,7 +3016,7 @@ void draw_cal_status(void)
|
|
|
|
|
|
|
|
|
|
|
|
// Average
|
|
|
|
// Average
|
|
|
|
if (setting.average>0) {
|
|
|
|
if (setting.average>0) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("Calc:", x, y);
|
|
|
|
ili9341_drawstring("Calc:", x, y);
|
|
|
|
|
|
|
|
|
|
|
|
@ -3025,7 +3027,7 @@ void draw_cal_status(void)
|
|
|
|
// Spur
|
|
|
|
// Spur
|
|
|
|
#ifdef __SPUR__
|
|
|
|
#ifdef __SPUR__
|
|
|
|
if (setting.spur_removal) {
|
|
|
|
if (setting.spur_removal) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("Spur:", x, y);
|
|
|
|
ili9341_drawstring("Spur:", x, y);
|
|
|
|
|
|
|
|
|
|
|
|
@ -3034,7 +3036,7 @@ void draw_cal_status(void)
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (setting.mirror_masking) {
|
|
|
|
if (setting.mirror_masking) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("Mask:", x, y);
|
|
|
|
ili9341_drawstring("Mask:", x, y);
|
|
|
|
|
|
|
|
|
|
|
|
@ -3045,16 +3047,16 @@ void draw_cal_status(void)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
if (setting.subtract_stored) {
|
|
|
|
if (setting.subtract_stored) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("Norm.", x, y);
|
|
|
|
ili9341_drawstring("Norm.", x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// RBW
|
|
|
|
// RBW
|
|
|
|
if (setting.rbw_x10)
|
|
|
|
if (setting.rbw_x10)
|
|
|
|
color = BRIGHT_COLOR_GREEN;
|
|
|
|
color = LCD_BRIGHT_COLOR_GREEN;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
color = DEFAULT_FG_COLOR;
|
|
|
|
color = LCD_FG_COLOR;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
|
|
|
|
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
@ -3067,7 +3069,7 @@ void draw_cal_status(void)
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
// VBW
|
|
|
|
// VBW
|
|
|
|
if (setting.frequency_step > 0) {
|
|
|
|
if (setting.frequency_step > 0) {
|
|
|
|
ili9341_set_foreground(DEFAULT_FG_COLOR);
|
|
|
|
ili9341_set_foreground(LCD_FG_COLOR);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("VBW:", x, y);
|
|
|
|
ili9341_drawstring("VBW:", x, y);
|
|
|
|
|
|
|
|
|
|
|
|
@ -3079,9 +3081,9 @@ void draw_cal_status(void)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
// Sweep time
|
|
|
|
// Sweep time
|
|
|
|
if (setting.step_delay != 0)
|
|
|
|
if (setting.step_delay != 0)
|
|
|
|
color = BRIGHT_COLOR_GREEN;
|
|
|
|
color = LCD_BRIGHT_COLOR_GREEN;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
color = DEFAULT_FG_COLOR;
|
|
|
|
color = LCD_FG_COLOR;
|
|
|
|
|
|
|
|
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
|
|
|
|
|
|
|
|
@ -3120,7 +3122,7 @@ void draw_cal_status(void)
|
|
|
|
|
|
|
|
|
|
|
|
// Cal output
|
|
|
|
// Cal output
|
|
|
|
if (setting.refer >= 0) {
|
|
|
|
if (setting.refer >= 0) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("Ref:", x, y);
|
|
|
|
ili9341_drawstring("Ref:", x, y);
|
|
|
|
|
|
|
|
|
|
|
|
@ -3132,7 +3134,7 @@ void draw_cal_status(void)
|
|
|
|
|
|
|
|
|
|
|
|
// Offset
|
|
|
|
// Offset
|
|
|
|
if (setting.offset != 0.0) {
|
|
|
|
if (setting.offset != 0.0) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("Amp:", x, y);
|
|
|
|
ili9341_drawstring("Amp:", x, y);
|
|
|
|
|
|
|
|
|
|
|
|
@ -3143,7 +3145,7 @@ void draw_cal_status(void)
|
|
|
|
|
|
|
|
|
|
|
|
// Repeat
|
|
|
|
// Repeat
|
|
|
|
if (setting.repeat != 1) {
|
|
|
|
if (setting.repeat != 1) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("Repeat:", x, y);
|
|
|
|
ili9341_drawstring("Repeat:", x, y);
|
|
|
|
|
|
|
|
|
|
|
|
@ -3156,9 +3158,9 @@ void draw_cal_status(void)
|
|
|
|
// Trigger
|
|
|
|
// Trigger
|
|
|
|
if (setting.trigger != T_AUTO) {
|
|
|
|
if (setting.trigger != T_AUTO) {
|
|
|
|
if (is_paused() || setting.trigger == T_NORMAL) {
|
|
|
|
if (is_paused() || setting.trigger == T_NORMAL) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_RED);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring("TRIG:", x, y);
|
|
|
|
ili9341_drawstring("TRIG:", x, y);
|
|
|
|
@ -3174,16 +3176,16 @@ void draw_cal_status(void)
|
|
|
|
|
|
|
|
|
|
|
|
// Mode
|
|
|
|
// Mode
|
|
|
|
if (level_is_calibrated())
|
|
|
|
if (level_is_calibrated())
|
|
|
|
color = BRIGHT_COLOR_GREEN;
|
|
|
|
color = LCD_BRIGHT_COLOR_GREEN;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
color = BRIGHT_COLOR_RED;
|
|
|
|
color = LCD_BRIGHT_COLOR_RED;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
ili9341_drawstring_7x13(MODE_LOW(setting.mode) ? "LOW" : "HIGH", x, y);
|
|
|
|
ili9341_drawstring_7x13(MODE_LOW(setting.mode) ? "LOW" : "HIGH", x, y);
|
|
|
|
|
|
|
|
|
|
|
|
// Compact status string
|
|
|
|
// Compact status string
|
|
|
|
// ili9341_set_background(DEFAULT_FG_COLOR);
|
|
|
|
// ili9341_set_background(LCD_FG_COLOR);
|
|
|
|
ili9341_set_foreground(DEFAULT_FG_COLOR);
|
|
|
|
ili9341_set_foreground(LCD_FG_COLOR);
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
y += YSTEP + YSTEP/2 ;
|
|
|
|
strncpy(buf," ",BLEN-1);
|
|
|
|
strncpy(buf," ",BLEN-1);
|
|
|
|
if (setting.auto_attenuation)
|
|
|
|
if (setting.auto_attenuation)
|
|
|
|
@ -3217,7 +3219,7 @@ void draw_cal_status(void)
|
|
|
|
strncpy(buf,&VERSION[8], BLEN-1);
|
|
|
|
strncpy(buf,&VERSION[8], BLEN-1);
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
|
|
|
|
|
|
|
|
// ili9341_set_background(DEFAULT_BG_COLOR);
|
|
|
|
// ili9341_set_background(LCD_BG_COLOR);
|
|
|
|
if (!get_waterfall()) { // Do not draw bottom level if in waterfall mode
|
|
|
|
if (!get_waterfall()) { // Do not draw bottom level if in waterfall mode
|
|
|
|
// Bottom level
|
|
|
|
// Bottom level
|
|
|
|
y = area_height - 8 + OFFSETY;
|
|
|
|
y = area_height - 8 + OFFSETY;
|
|
|
|
@ -3228,11 +3230,11 @@ void draw_cal_status(void)
|
|
|
|
// buf[5]=0;
|
|
|
|
// buf[5]=0;
|
|
|
|
if (level_is_calibrated())
|
|
|
|
if (level_is_calibrated())
|
|
|
|
if (setting.auto_reflevel)
|
|
|
|
if (setting.auto_reflevel)
|
|
|
|
color = DEFAULT_FG_COLOR;
|
|
|
|
color = LCD_FG_COLOR;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
color = BRIGHT_COLOR_GREEN;
|
|
|
|
color = LCD_BRIGHT_COLOR_GREEN;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
color = BRIGHT_COLOR_RED;
|
|
|
|
color = LCD_BRIGHT_COLOR_RED;
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
ili9341_drawstring(buf, x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -3333,7 +3335,7 @@ void cell_draw_test_info(int x0, int y0)
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
int xpos = 25 - x0;
|
|
|
|
int xpos = 25 - x0;
|
|
|
|
int ypos = 50+i*INFO_SPACING - y0;
|
|
|
|
int ypos = 50+i*INFO_SPACING - y0;
|
|
|
|
unsigned int color = RGBHEX(0xFFFFFF);
|
|
|
|
unsigned int color = LCD_FG_COLOR;
|
|
|
|
if (i == -1) {
|
|
|
|
if (i == -1) {
|
|
|
|
plot_printf(self_test_status_buf, sizeof self_test_status_buf, "Self test status:");
|
|
|
|
plot_printf(self_test_status_buf, sizeof self_test_status_buf, "Self test status:");
|
|
|
|
} else if (test_case[i].kind == TC_END) {
|
|
|
|
} else if (test_case[i].kind == TC_END) {
|
|
|
|
@ -3344,13 +3346,13 @@ void cell_draw_test_info(int x0, int y0)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
plot_printf(self_test_status_buf, sizeof self_test_status_buf, "Test %d: %s%s", i+1, test_fail_cause[i], test_text[test_status[i]] );
|
|
|
|
plot_printf(self_test_status_buf, sizeof self_test_status_buf, "Test %d: %s%s", i+1, test_fail_cause[i], test_text[test_status[i]] );
|
|
|
|
if (test_status[i] == TS_PASS)
|
|
|
|
if (test_status[i] == TS_PASS)
|
|
|
|
color = RGBHEX(0x00FF00);
|
|
|
|
color = LCD_BRIGHT_COLOR_GREEN;
|
|
|
|
else if (test_status[i] == TS_CRITICAL)
|
|
|
|
else if (test_status[i] == TS_CRITICAL)
|
|
|
|
color = RGBHEX(0xFFFF00);
|
|
|
|
color = LCD_TRACE_3_COLOR; // Yellow
|
|
|
|
else if (test_status[i] == TS_FAIL)
|
|
|
|
else if (test_status[i] == TS_FAIL)
|
|
|
|
color = RGBHEX(0xFF7F7F);
|
|
|
|
color = LCD_BRIGHT_COLOR_RED;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
color = RGBHEX(0x0000FF);
|
|
|
|
color = LCD_BRIGHT_COLOR_BLUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
ili9341_set_foreground(color);
|
|
|
|
cell_drawstring(self_test_status_buf, xpos, ypos);
|
|
|
|
cell_drawstring(self_test_status_buf, xpos, ypos);
|
|
|
|
@ -3658,7 +3660,7 @@ void self_test(int test)
|
|
|
|
if (test_step == 2) {
|
|
|
|
if (test_step == 2) {
|
|
|
|
if (peakLevel < -60) {
|
|
|
|
if (peakLevel < -60) {
|
|
|
|
test_step = TEST_END;
|
|
|
|
test_step = TEST_END;
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_RED);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
|
|
|
|
ili9341_drawstring_7x13("Signal level too low", 30, 140);
|
|
|
|
ili9341_drawstring_7x13("Signal level too low", 30, 140);
|
|
|
|
ili9341_drawstring_7x13("Check cable between High and Low connectors", 30, 160);
|
|
|
|
ili9341_drawstring_7x13("Check cable between High and Low connectors", 30, 160);
|
|
|
|
goto resume2;
|
|
|
|
goto resume2;
|
|
|
|
@ -3674,7 +3676,7 @@ void self_test(int test)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
test_step++;
|
|
|
|
test_step++;
|
|
|
|
} while (test_case[test_step].kind != TC_END && setting.test_argument == 0 );
|
|
|
|
} while (test_case[test_step].kind != TC_END && setting.test_argument == 0 );
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_drawstring_7x13("Self test complete", 50, 200);
|
|
|
|
ili9341_drawstring_7x13("Self test complete", 50, 200);
|
|
|
|
ili9341_drawstring_7x13("Touch screen to continue", 50, 215);
|
|
|
|
ili9341_drawstring_7x13("Touch screen to continue", 50, 215);
|
|
|
|
resume2:
|
|
|
|
resume2:
|
|
|
|
@ -3925,14 +3927,14 @@ void calibrate(void)
|
|
|
|
test_acquire(TEST_POWER); // Acquire test
|
|
|
|
test_acquire(TEST_POWER); // Acquire test
|
|
|
|
local_test_status = test_validate(TEST_POWER); // Validate test
|
|
|
|
local_test_status = test_validate(TEST_POWER); // Validate test
|
|
|
|
if (peakLevel < -50) {
|
|
|
|
if (peakLevel < -50) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_RED);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
|
|
|
|
ili9341_drawstring_7x13("Signal level too low", 30, 140);
|
|
|
|
ili9341_drawstring_7x13("Signal level too low", 30, 140);
|
|
|
|
ili9341_drawstring_7x13("Check cable between High and Low connectors", 30, 160);
|
|
|
|
ili9341_drawstring_7x13("Check cable between High and Low connectors", 30, 160);
|
|
|
|
goto quit;
|
|
|
|
goto quit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// chThdSleepMilliseconds(1000);
|
|
|
|
// chThdSleepMilliseconds(1000);
|
|
|
|
if (local_test_status != TS_PASS) {
|
|
|
|
if (local_test_status != TS_PASS) {
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_RED);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
|
|
|
|
ili9341_drawstring_7x13("Calibration failed", 30, 140);
|
|
|
|
ili9341_drawstring_7x13("Calibration failed", 30, 140);
|
|
|
|
goto quit;
|
|
|
|
goto quit;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -3968,7 +3970,7 @@ void calibrate(void)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
config_save();
|
|
|
|
config_save();
|
|
|
|
ili9341_set_foreground(BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_set_foreground(LCD_BRIGHT_COLOR_GREEN);
|
|
|
|
ili9341_drawstring_7x13("Calibration complete", 30, 140);
|
|
|
|
ili9341_drawstring_7x13("Calibration complete", 30, 140);
|
|
|
|
quit:
|
|
|
|
quit:
|
|
|
|
ili9341_drawstring_7x13("Touch screen to continue", 30, 200);
|
|
|
|
ili9341_drawstring_7x13("Touch screen to continue", 30, 200);
|
|
|
|
|