diff --git a/NANOVNA_STM32_F072/board.h b/NANOVNA_STM32_F072/board.h index 7d5a539..f228585 100644 --- a/NANOVNA_STM32_F072/board.h +++ b/NANOVNA_STM32_F072/board.h @@ -117,7 +117,6 @@ * PA13 - SWDIO (alternate 0). * PA14 - SWCLK (alternate 0). */ -#define __ULTRA_SA__ #ifdef __ULTRA_SA__ #define PIN_MOD_ULTRA(X) PIN_MODE_OUTPUT(X) #else diff --git a/main.c b/main.c index b119432..2ef1f60 100644 --- a/main.c +++ b/main.c @@ -2255,7 +2255,9 @@ VNA_SHELL_FUNCTION(cmd_x) reg &= ~0xc00000; // Force led to show lock reg |= 0x400000; } +#ifdef __ULTRA_SA__ ADF4351_WriteRegister32(VFO, reg); +#endif shell_printf("x=%x\r\n", reg); } @@ -2757,9 +2759,9 @@ int main(void) int i = sdReadTimeout(&SD1,buf,10,TIME_IMMEDIATE); #endif - +#ifdef __ULTRA_SA__ ADF4351_Setup(); - +#endif /* * SPI LCD Initialize */ diff --git a/nanovna.h b/nanovna.h index 61e9c95..6fbc161 100644 --- a/nanovna.h +++ b/nanovna.h @@ -30,8 +30,9 @@ #define __MEASURE__ #define __SELFTEST__ #define __CALIBRATE__ -#define __ULTRA__ -#define __ULTRA_SA__ +//#define __ULTRA__ // Add harmonics mode on low input. +//#define __ULTRA_SA__ // Adds ADF4351 control for extra high 1st IF stage + /* * main.c diff --git a/sa_core.c b/sa_core.c index 7ffb79c..e345b96 100644 --- a/sa_core.c +++ b/sa_core.c @@ -105,8 +105,13 @@ void reset_settings(int m) set_sweep_frequency(ST_SPAN, 0); break; case M_HIGH: +#ifdef __ULTRA_SA__ minFreq = 00000000; maxFreq = 2000000000; +#else + minFreq = 240000000; + maxFreq = 960000000; +#endif set_sweep_frequency(ST_START, (int32_t) minFreq); set_sweep_frequency(ST_STOP, (int32_t) maxFreq); break; @@ -526,8 +531,10 @@ void setFreq(int V, unsigned long freq) if (V <= 1) { SI4432_Sel = V; SI4432_Set_Frequency(freq); +#ifdef __ULTRA_SA__ } else { ADF4351_set_frequency(V-2,freq,3); +#endif } old_freq[V] = freq; } @@ -959,14 +966,17 @@ again: } else #endif { +#ifdef __ULTRA_SA__ //#define IF_1 2550000000 #define IF_2 2025000000 - setFreq (3, IF_2 - 433800000); - setFreq (2, IF_2 + lf); - setFreq (1, 433800000); -// setFreq (1, local_IF+lf); - } + setFreq (3, IF_2 - 433800000); + setFreq (2, IF_2 + lf); + setFreq (1, 433800000); +#else + setFreq (1, local_IF+lf); +#endif + } if (MODE_OUTPUT(setting_mode)) // No substepping in output mode return(0); float signal_path_loss; diff --git a/si4432.c b/si4432.c index 1cffc06..d16ee21 100644 --- a/si4432.c +++ b/si4432.c @@ -505,7 +505,6 @@ float Simulated_SI4432_RSSI(uint32_t i, int s) #endif //------------------------------- ADF4351 ------------------------------------- - #ifdef __ULTRA_SA__ #define bitRead(value, bit) (((value) >> (bit)) & 0x01) diff --git a/ui_sa.c b/ui_sa.c index 81f89c0..9aae4f5 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -890,12 +890,14 @@ static void choose_active_marker(void) active_marker = -1; } +#ifdef __ULTRA__ static void menu_harmonic_cb(int item, uint8_t data) { (void)item; set_harmonic(data); draw_menu(); } +#endif static void menu_settings2_cb(int item, uint8_t data) { @@ -1495,9 +1497,11 @@ static void menu_item_modify_attribute( if (item ==0 && setting_tracking_output){ mark = true; } +#ifdef __ULTRA__ } else if (MT_MASK(menu[item].type) == MT_CALLBACK && menu == menu_harmonic) { if (data == setting_harmonic) mark = true; +#endif } else if (menu == menu_settings2 || menu == menu_settingshigh2) { if (item ==0 && setting_agc){ mark = true;