diff --git a/main.c b/main.c index 7044573..eb264fe 100644 --- a/main.c +++ b/main.c @@ -88,7 +88,7 @@ uint16_t redraw_request = 0; // contains REDRAW_XXX flags // Version text, displayed in Config->Version menu, also send by info command const char *info_about[]={ BOARD_NAME, - "2019-2020 Copyright @Erik Kaashoek", + "2019-2022 Copyright @Erik Kaashoek", "2016-2020 Copyright @edy555", "SW licensed under GPL. See: https://github.com/erikkaashoek/tinySA", "Version: " VERSION, diff --git a/nanovna.h b/nanovna.h index 654a6c4..72ca6ab 100644 --- a/nanovna.h +++ b/nanovna.h @@ -18,7 +18,7 @@ */ #include "ch.h" -//#ifdef TINYSA_F303 +#ifdef TINYSA_F303 #ifdef TINYSA_F072 #error "Remove comment for #ifdef TINYSA_F303" #endif @@ -26,7 +26,7 @@ #define TINYSA4 #endif #define TINYSA4_PROTO -//#endif +#endif #ifdef TINYSA_F072 #ifdef TINYSA_F303 @@ -219,8 +219,7 @@ typedef uint32_t freq_t; #define CORRECTION_LOW_OUT_DIRECT 7 #define CORRECTION_LOW_OUT_ADF 8 #define CORRECTION_LOW_OUT_MIXER 9 - #define CORRECTION_HIGH 10 - #define CORRECTION_SIZE 11 + #define CORRECTION_SIZE 10 #endif typedef float measurement_t[TRACES_MAX][POINTS_COUNT]; extern measurement_t measured; diff --git a/sa_cmd.c b/sa_cmd.c index a5454d4..f58b9d5 100644 --- a/sa_cmd.c +++ b/sa_cmd.c @@ -22,16 +22,26 @@ static int points = 101; // For 's' and 'm' commands VNA_SHELL_FUNCTION(cmd_mode) { +#ifdef TINYSA3 static const char cmd_low_high[] = "low|high"; +#endif static const char cmd_in_out[] = "input|output"; if (argc != 2) { usage: - usage_printf("mode %s %s\r\n", cmd_low_high,cmd_in_out); +#ifdef TINYSA4 + shell_printf("usage: mode low %s\r\n", cmd_in_out); +#else + shell_printf("usage: mode %s %s\r\n", cmd_low_high,cmd_in_out); +#endif return; } +#ifdef TINYSA3 int lh = get_str_index(argv[0], cmd_low_high); +#else + int lh = 0; +#endif int io = get_str_index(argv[1], cmd_in_out); - if (lh<0 || io<0) + if (lh < 0 || io<0) goto usage; menu_move_top(); switch(lh+io*2) @@ -40,18 +50,22 @@ VNA_SHELL_FUNCTION(cmd_mode) set_mode(M_LOW); ui_mode_normal(); break; +#ifdef TINYSA3 case 1: set_mode(M_HIGH); ui_mode_normal(); break; +#endif case 2: set_mode(M_GENLOW); menu_push_lowoutput(); break; +#ifdef TINYSA3 case 3: set_mode(M_GENHIGH); menu_push_highoutput(); break; +#endif } } @@ -358,8 +372,12 @@ VNA_SHELL_FUNCTION(cmd_ext_gain) VNA_SHELL_FUNCTION(cmd_levelchange) { - if (argc != 1 || argv[0][0] == '?') { - usage_printf("levelchange -70..+70\r\n"); + if (argc != 1) { +#ifdef TINYSA4 + shell_printf("usage: levelchange -90..+90\r\n"); +#else + shell_printf("usage: levelchange -70..+70\r\n"); +#endif return; } float f = my_atof(argv[0]); @@ -510,7 +528,7 @@ VNA_SHELL_FUNCTION(cmd_rbw) if (argc != 1 || argv[0][0] == '?') { usage: #ifdef TINYSA4 - usage_printf("rbw 0.3..850|auto\r\n%.1FHz\r\n", actual_rbw_x10*100.0); + usage_printf("rbw 0.2..850|auto\r\n%.1FHz\r\n", actual_rbw_x10*100.0); #else usage_printf("rbw 2..600|auto\r\n%.1FHz\r\n", actual_rbw_x10*100.0); #endif @@ -538,7 +556,11 @@ VNA_SHELL_FUNCTION(cmd_if) { if (argc != 1 || argv[0][0] == '?') { usage: - usage_printf("if {433M..435M}\r\n%QHz\r\n", setting.frequency_IF); +#ifdef TINYSA4 + usage_printf("usage: if {975M..979M}\r\n%QHz\r\n", setting.frequency_IF); +#else + usage_printf("usage: if {433M..435M}\r\n%QHz\r\n", setting.frequency_IF); +#endif return; } freq_t a = (freq_t)my_atoi(argv[0]); @@ -1120,7 +1142,7 @@ VNA_SHELL_FUNCTION(cmd_correction) { (void)argc; #ifdef TINYSA4 - static const char cmd[] = "low|lna|ultra|ultra_lna|direct|direct_lna|out|out_direct|out_adf|out_ultra|high|off|on"; + static const char cmd[] = "low|lna|ultra|ultra_lna|direct|direct_lna|out|out_direct|out_adf|out_ultra|off|on"; static const char range[] = "0-19"; #else static const char cmd[] = "low|high"; diff --git a/sa_core.c b/sa_core.c index 2aaf053..7784fed 100644 --- a/sa_core.c +++ b/sa_core.c @@ -2156,10 +2156,12 @@ pureRSSI_t get_frequency_correction(freq_t f) // Frequency dependent RSSI c { pureRSSI_t cv = 0; int c=CORRECTION_LOW; +#ifdef TINYSA3 if (setting.mode == M_GENHIGH) { c = CORRECTION_HIGH; return float_TO_PURE_RSSI(0.0); } +#endif #ifdef TINYSA4 if (setting.mode == M_LOW) {