diff --git a/ili9341.c b/ili9341.c index 48d9984..fe5be17 100644 --- a/ili9341.c +++ b/ili9341.c @@ -1172,7 +1172,7 @@ static DSTATUS Stat = STA_NOINIT; // Disk Status static uint8_t CardType = 0; // Type 0:MMC, 1:SDC, 2:Block addressing // Debug functions, 0 to disable -#define DEBUG 0 +#define DEBUG 1 int shell_printf(const char *fmt, ...); #define DEBUG_PRINT(...) do { if (DEBUG) shell_printf(__VA_ARGS__); } while (0) #if DEBUG == 1 diff --git a/plot.c b/plot.c index be669f9..71c6e7a 100644 --- a/plot.c +++ b/plot.c @@ -327,7 +327,7 @@ marker_to_value(const int i) if (markers[i].mtype & M_NOISE){ v = v - logf(actual_rbw_x10*100.0) * (10.0/logf(10.0)) #ifdef TINYSA4 - + SI4463_noise_correction_x10/10.0 + (linear_averaging ? 0.0 : log_averaging_correction); + + ((float)SI4463_noise_correction_x10)/10.0 + (linear_averaging ? 0.0 : log_averaging_correction); #endif ; } diff --git a/si4468.c b/si4468.c index 3c7c936..33782cd 100644 --- a/si4468.c +++ b/si4468.c @@ -1737,15 +1737,15 @@ static const RBW_t RBW_choices[] = #else #define NOISE_BASE_CORRECTION 7 // 7 - {SI4463_RBW_02kHz, 10,2, NOISE_BASE_CORRECTION + 2}, // - {SI4463_RBW_1kHz, 15,10, NOISE_BASE_CORRECTION + -12},// + {SI4463_RBW_02kHz, 10,2, NOISE_BASE_CORRECTION + 0}, // + {SI4463_RBW_1kHz, 15,10, NOISE_BASE_CORRECTION + -5},// {SI4463_RBW_3kHz, 10,30, NOISE_BASE_CORRECTION + -5},// - {SI4463_RBW_10kHz, 14,100,NOISE_BASE_CORRECTION + 0}, // - {SI4463_RBW_30kHz, 0,300, NOISE_BASE_CORRECTION + 0},// - {SI4463_RBW_100kHz, 0,1000,NOISE_BASE_CORRECTION + -2},// + {SI4463_RBW_10kHz, 14,100,NOISE_BASE_CORRECTION + -2}, // + {SI4463_RBW_30kHz, 0,300, NOISE_BASE_CORRECTION + -2},// + {SI4463_RBW_100kHz, 0,1000,NOISE_BASE_CORRECTION + -1},// {SI4463_RBW_300kHz, 0,3000,NOISE_BASE_CORRECTION}, // 300k must have RSSI correction = 0 - {SI4463_RBW_600kHz, 5,6000,NOISE_BASE_CORRECTION + -0},// - {SI4463_RBW_850kHz, 8,8500,NOISE_BASE_CORRECTION + 3},// + {SI4463_RBW_600kHz, 5,6000,NOISE_BASE_CORRECTION + -2},// + {SI4463_RBW_850kHz, 8,8500,NOISE_BASE_CORRECTION + 2},// #endif }; diff --git a/ui_sa.c b/ui_sa.c index 3fe3de1..a2eb578 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -1785,9 +1785,10 @@ validate: nf_gain = 0.00001; // almost zero goto noise_figure; case M_NF_AMPLIFIER: // noise figure -// reset_settings(setting.mode); +#if 0 reset_settings(setting.mode); set_refer_output(-1); +#endif kp_help_text = "Amplifier Gain "; float old_gain = setting.external_gain; ui_mode_keypad(KM_EXT_GAIN); @@ -1798,7 +1799,7 @@ validate: markers[0].mtype = M_NOISE | M_AVER; // Not tracking set_extra_lna(true); set_attenuation(0); - if (data != M_NF_VALIDATE) { + if (data == M_NF_TINYSA) { kp_help_text = "Noise center frequency"; ui_mode_keypad(KM_CENTER); set_marker_frequency(0, uistat.value); @@ -4347,40 +4348,38 @@ redraw_cal_status: // lcd_printf(x, y, "%4f", value(setting.trigger_level)/setting.unit_scale); y = add_quick_menu(y,(menuitem_t *)menu_trigger); } - +#ifndef TINYSA4 // Mode ili9341_set_foreground(level_is_calibrated() ? LCD_BRIGHT_COLOR_GREEN : LCD_BRIGHT_COLOR_RED); ili9341_drawstring_7x13(MODE_LOW(setting.mode) ? "LOW" : "HIGH", x, y); - + y += YSTEP + YSTEP/2 ; +#endif // Compact status string // ili9341_set_background(LCD_FG_COLOR); ili9341_set_foreground(LCD_FG_COLOR); - y += YSTEP + YSTEP/2 ; strncpy(buf," ",BLEN-1); - if (setting.auto_attenuation) - buf[0] = 'a'; - else - buf[0] = 'A'; if (setting.auto_IF) - buf[1] = 'f'; + buf[0] = 'f'; else - buf[1] = 'F'; - if (setting.auto_reflevel) - buf[2] = 'r'; - else - buf[2] = 'R'; + buf[0] = 'F'; if (S_IS_AUTO(setting.agc)) - buf[3] = 'g'; + buf[1] = 'g'; else if (S_STATE(setting.agc)) - buf[3] = 'G'; + buf[1] = 'G'; if (S_IS_AUTO(setting.lna)) - buf[4] = 'n'; + buf[2] = 'n'; else if (S_STATE(setting.lna)) - buf[4] = 'N'; + buf[2] = 'N'; if (S_IS_AUTO(setting.below_IF)) - buf[5] = 'b'; + buf[3] = 'b'; else if (S_STATE(setting.below_IF)) - buf[5] = 'B'; + buf[3] = 'B'; +#ifdef TINYSA4 + if (S_IS_AUTO(setting.spur_removal)) + buf[4] = 's'; + else if (S_STATE(setting.spur_removal)) + buf[4] = 'S'; +#endif ili9341_drawstring(buf, x, y); // Version