diff --git a/NANOVNA_STM32_F072/board.h b/NANOVNA_STM32_F072/board.h index 2e33d06..8bc0aa4 100644 --- a/NANOVNA_STM32_F072/board.h +++ b/NANOVNA_STM32_F072/board.h @@ -177,7 +177,7 @@ PIN_PUPDR_PULLDOWN(2) | \ PIN_PUPDR_PULLDOWN(3) | \ PIN_PUPDR_FLOATING(4) | \ - PIN_PUPDR_PULLDOWN(5) | \ + PIN_PUPDR_PULLUP(5) | \ PIN_PUPDR_FLOATING(6) | \ PIN_PUPDR_FLOATING(7) | \ PIN_PUPDR_PULLUP(GPIOA_MCO) | \ diff --git a/main.c b/main.c index 1c3ed1e..eb69ba3 100644 --- a/main.c +++ b/main.c @@ -2119,7 +2119,7 @@ int main(void) #ifdef TINYSA3 has_esd = ((palReadPort(GPIOB) & (1<<12)) ? false : true ); - + bool has_new_switch = ((palReadPort(GPIOA) & (1<<5)) ? false : true ) || ((palReadPort(GPIOB) & (1<<12)) ? false : true ); #endif @@ -2184,7 +2184,7 @@ int main(void) /* restore config */ #ifdef TINYSA3 - if (has_esd) + if (has_new_switch) config.switch_offset = -5.0; #endif config_recall(); diff --git a/sa_core.c b/sa_core.c index d3e15d7..bd26a35 100644 --- a/sa_core.c +++ b/sa_core.c @@ -5381,8 +5381,7 @@ quit: #endif reset_settings(M_LOW); set_refer_output(-1); -#ifdef TINYSA4 - } else if (test == 1) { + } else if (false && test == 1) { float p2, p1, p; in_selftest = true; // Spur search reset_settings(M_LOW); @@ -5430,7 +5429,7 @@ quit: shell_printf("%d, %d\n\r", ((int)temp_t[j])/1000, (int)stored_t[j]); } reset_settings(M_LOW); - } else if (test == 2) { // Attenuator test + } else if (false && test == 2) { // Attenuator test in_selftest = true; reset_settings(M_LOW); #if 1 @@ -5441,7 +5440,9 @@ quit: set_attenuation(((float)j)/2.0); if (setting.test_argument) set_sweep_frequency(ST_CENTER, ((freq_t)setting.test_argument)); +#ifdef TINYSA4 ultra_threshold = config.ultra_threshold; +#endif test_acquire(TEST_LEVEL); // Acquire test test_validate(TEST_LEVEL); // Validate test if (j == 0) @@ -5463,8 +5464,7 @@ quit: test_validate(TEST_ATTEN); // Validate test #endif reset_settings(M_LOW); -#endif - } else if (test == 3) { // RBW step time search + } else if (false && test == 3) { // RBW step time search in_selftest = true; ui_mode_normal(); test_prepare(TEST_RBW); @@ -5572,8 +5572,7 @@ quit: reset_settings(M_LOW); setting.step_delay_mode = SD_NORMAL; setting.step_delay = 0; -#ifdef TINYSA4 - } else if (test == 4) { // Calibrate modulation frequencies + } else if (false && test == 4) { // Calibrate modulation frequencies reset_settings(M_LOW); set_mode(M_GENLOW); set_sweep_frequency(ST_CENTER, (freq_t)30000000); @@ -5604,7 +5603,7 @@ quit: // shell_printf("\n\rCycle time = %d\n\r", start_of_sweep_timestamp); reset_settings(M_LOW); - } else if (test == 5) { + } else if (false && test == 5) { // reset_settings(M_LOW); // Make sure we are in a defined state in_selftest = true; switch (setting.test_argument) { @@ -5640,7 +5639,7 @@ quit: set_sweep_frequency(ST_SPAN, 0); break; } - } else if (test == 6) { + } else if (false && test == 6) { in_selftest = true; // MCU Spur search reset_settings(M_LOW); test_prepare(TEST_SPUR); @@ -5658,8 +5657,7 @@ quit: shell_printf("%d: %9.3q\n\r",i, peakFreq); test_validate(TEST_SPUR); // Validate test } -#endif - } else if (test == 7) { // RBW level test + } else if (false && test == 7) { // RBW level test in_selftest = true; ui_mode_normal(); shell_printf("\n\r"); diff --git a/ui_sa.c b/ui_sa.c index 5841c23..9afdffd 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -491,7 +491,9 @@ static const struct { #endif [KM_MARKER_TIME] = {keypads_time , "MARKER\nTIME"}, // KM_MARKER_TIME [KM_VAR] = {keypads_freq , "JOG\nSTEP"}, // jog step +#ifdef __NOISE_FIGURE__ [KM_NF] = {keypads_plusmin , "NOISE\nFIGURE"}, // noise figure of tinySA +#endif }; #if 0 // Not used @@ -1175,7 +1177,9 @@ static UI_FUNCTION_ADV_CALLBACK(menu_measure_acb) } set_average(AV_OFF); set_external_gain(0.0); +#ifdef TINYSA4 set_extra_lna(false); +#endif } switch(data) { case M_OFF: // Off