diff --git a/NANOVNA_STM32_F072/board.h b/NANOVNA_STM32_F072/board.h index 6ec8e5e..2e33d06 100644 --- a/NANOVNA_STM32_F072/board.h +++ b/NANOVNA_STM32_F072/board.h @@ -247,7 +247,7 @@ PIN_MODE_OUTPUT(GPIO_RF_PWR) | \ PIN_MODE_OUTPUT(GPIO_SPI2_CLK) | \ PIN_MODE_OUTPUT(11) | \ - PIN_MODE_OUTPUT(12) | \ + PIN_MODE_INPUT(12) | \ PIN_MODE_OUTPUT(13) | \ PIN_MODE_INPUT(GPIO_SPI2_SDO) | \ PIN_MODE_OUTPUT(GPIO_SPI2_SDI)) diff --git a/main.c b/main.c index b73e16c..a54d2e0 100644 --- a/main.c +++ b/main.c @@ -123,13 +123,13 @@ const char *info_about[]={ }; bool dirty = true; - bool completed = false; #ifdef TINYSA4 static THD_WORKING_AREA(waThread1, 1124); #else static THD_WORKING_AREA(waThread1, 768); +bool has_esd = false; #endif static THD_FUNCTION(Thread1, arg) { @@ -1022,7 +1022,7 @@ config_t config = { .cor_am = 0, .cor_wfm = 0, .cor_nfm = 0, - .ultra = false, + .ultra = true, .high_out_adf4350 = true, .ext_zero_level = 174, #endif @@ -2278,6 +2278,10 @@ VNA_SHELL_FUNCTION(cmd_info) int i = 0; while (info_about[i]) shell_printf("%s\r\n", info_about[i++]); +#ifdef TINYSA3 + if (has_esd) + shell_printf("ESD protected\r\n"); +#endif } #endif @@ -2851,6 +2855,11 @@ int main(void) si5351_init(); #endif +#ifdef TINYSA3 + has_esd = ((palReadPort(GPIOB) & (1<<12)) ? false : true ); +#endif + + #ifdef __SI4432__ /* * Powercycle the RF part to reset SI4432 diff --git a/nanovna.h b/nanovna.h index 8b15090..f08d2c6 100644 --- a/nanovna.h +++ b/nanovna.h @@ -84,7 +84,7 @@ #define HIGH_MAX_FREQ_MHZ 960 #endif #ifdef TINYSA4 -#define DEFAULT_IF ((freq_t)977100000) +#define DEFAULT_IF ((freq_t)977400000) #define DEFAULT_SPUR_OFFSET ((freq_t)1500000) #define DEFAULT_MAX_FREQ ((freq_t)800000000) #define HIGH_MIN_FREQ_MHZ 136// 825 @@ -120,6 +120,7 @@ #ifdef TINYSA3 typedef uint32_t freq_t; typedef int32_t long_t; + extern bool has_esd; #endif #ifdef TINYSA4 typedef uint64_t freq_t; diff --git a/plot.c b/plot.c index 1755880..3338597 100644 --- a/plot.c +++ b/plot.c @@ -1301,7 +1301,7 @@ static void cell_draw_marker_info(int x0, int y0) #ifdef __CHANNEL_POWER__ if (setting.measurement==M_CP) { for (int c=0; c<3;c++) { - plot_printf(buf, sizeof buf, "%4.1fdB", channel_power[c]); + plot_printf(buf, sizeof buf, "%4.1fdBm", channel_power[c]); int xpos = 10 + (c)*(WIDTH/3) + CELLOFFSETX - x0; int ypos = 1 - y0; ili9341_set_foreground(LCD_FG_COLOR); diff --git a/sa_cmd.c b/sa_cmd.c index b08b05d..ee69652 100644 --- a/sa_cmd.c +++ b/sa_cmd.c @@ -835,7 +835,7 @@ VNA_SHELL_FUNCTION(cmd_correction) if (argc == 0) { shell_printf("index frequency value\r\n"); for (int i=0; i>=1; y+=5;} while (shift&1); ili9341_drawstring(info_about[i++], x, y+=5); } +#ifdef TINYSA3 + if (has_esd) + ili9341_drawstring("ESD protected", x, y+=5); +#endif #ifdef TINYSA4 extern const char *states[]; #define ENABLE_THREADS_COMMAND