From da12600c3330cf50a2e8fd7869231fe9e656ef16 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 3 Nov 2022 15:20:55 +0100 Subject: [PATCH] fix https://github.com/erikkaashoek/tinySA/issues/33, fix F072 build #33: rename all Si446*.h and SI446*.h files to all lower case #33: change all #include "Si..." etc. accordingly F072: put some undefined tinySA3 items between "#ifdef TINYSA4" "#endif" Signed-off-by: Martin --- main.c | 2 ++ nanovna.h | 4 ++-- sa_cmd.c | 4 ++-- sa_core.c | 2 ++ SI4463_radio_config.h => si4463_radio_config.h | 0 si4468.c | 2 +- SI4468_radio_config.h => si4468_radio_config.h | 0 Si446x.h => si446x.h | 0 Si446x_defs.h => si446x_defs.h | 0 ui_sa.c | 6 ++++-- 10 files changed, 13 insertions(+), 7 deletions(-) rename SI4463_radio_config.h => si4463_radio_config.h (100%) rename SI4468_radio_config.h => si4468_radio_config.h (100%) rename Si446x.h => si446x.h (100%) rename Si446x_defs.h => si446x_defs.h (100%) diff --git a/main.c b/main.c index ead3953..fbb56aa 100644 --- a/main.c +++ b/main.c @@ -2083,7 +2083,9 @@ static const VNAShellCommand commands[] = { "agc", cmd_agc, CMD_RUN_IN_LOAD }, #endif { "actual_freq", cmd_actual_freq, CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD }, +#ifdef TINYSA4 { "freq_corr", cmd_freq_correction, CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD }, +#endif { "attenuate", cmd_attenuate, CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD }, { "level", cmd_level, CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD }, { "sweeptime", cmd_sweeptime, CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD }, diff --git a/nanovna.h b/nanovna.h index efd0d9a..212eadf 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 diff --git a/sa_cmd.c b/sa_cmd.c index 344ae45..60e2afa 100644 --- a/sa_cmd.c +++ b/sa_cmd.c @@ -51,8 +51,8 @@ VNA_SHELL_FUNCTION(cmd_mode) } else io = get_str_index(argv[1], cmd_in_out); #else - int lh = get_str_index(argv[0], cmd_low_high); - int io = get_str_index(argv[1], cmd_in_out); + lh = get_str_index(argv[0], cmd_low_high); + io = get_str_index(argv[1], cmd_in_out); #endif if (lh < 0 || io<0) goto usage; diff --git a/sa_core.c b/sa_core.c index c0b2610..3a05628 100644 --- a/sa_core.c +++ b/sa_core.c @@ -7629,7 +7629,9 @@ void calibrate(void) #endif #endif if (calibration_stage == CS_NORMAL && peakLevel < -40) { +#ifdef TINYSA4 low_level: +#endif ili9341_set_foreground(LCD_BRIGHT_COLOR_RED); ili9341_drawstring_7x13("Signal level incorrect", 30, 200); ili9341_drawstring_7x13("Check cable between connectors", 30, 220); diff --git a/SI4463_radio_config.h b/si4463_radio_config.h similarity index 100% rename from SI4463_radio_config.h rename to si4463_radio_config.h diff --git a/si4468.c b/si4468.c index 33782cd..5d2cb9b 100644 --- a/si4468.c +++ b/si4468.c @@ -899,7 +899,7 @@ static void SI4463_set_properties(uint16_t prop, void* values, uint8_t len) } #endif -#include "SI446x_cmd.h" +#include "si446x_cmd.h" #include "radio_config_Si4468_undef.h" #undef RADIO_CONFIGURATION_DATA_ARRAY diff --git a/SI4468_radio_config.h b/si4468_radio_config.h similarity index 100% rename from SI4468_radio_config.h rename to si4468_radio_config.h diff --git a/Si446x.h b/si446x.h similarity index 100% rename from Si446x.h rename to si446x.h diff --git a/Si446x_defs.h b/si446x_defs.h similarity index 100% rename from Si446x_defs.h rename to si446x_defs.h diff --git a/ui_sa.c b/ui_sa.c index a2eb578..7e608a5 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -446,8 +446,8 @@ enum { KM_RTC_DATE, KM_RTC_TIME, #endif - KM_CODE, #endif + KM_CODE, KM_NONE // always at enum end }; @@ -521,8 +521,8 @@ static const struct { [KM_RTC_DATE] = {keypads_positive , "SET DATE\n YYMMDD"}, // Date [KM_RTC_TIME] = {keypads_positive , "SET TIME\n HHMMSS"}, // Time #endif -[KM_CODE] = {keypads_positive , "CODE"}, // KM_CODE #endif +[KM_CODE] = {keypads_positive , "CODE"}, // KM_CODE }; #if 0 // Not used @@ -3193,7 +3193,9 @@ static const menuitem_t menu_settings[] = { MT_CALLBACK, 0 , "LOAD\nCONFIG.INI", menu_load_config_cb}, // { MT_CALLBACK, 1 , "LOAD\nSETTING.INI", menu_load_config_cb}, #endif +#ifdef TINYSA4 { MT_ADV_CALLBACK, 0, "INTERNALS", menu_internals_acb}, +#endif { MT_NONE, 0, NULL, menu_back} // next-> menu_back };