diff --git a/main.c b/main.c index 1f87b65..bd6e9fa 100644 --- a/main.c +++ b/main.c @@ -971,7 +971,7 @@ config_t config = { { 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low lna { 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low ultra in { 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low ultra lna - { 10000, 50000, 80000, 150000, 300000, 1000000, 5000000, 80000000, 100000000, 180000000, 650000000, 700000000, 760000000, 780000000, 790000000, 800000000, 800000000, 800000000, 800000000, 800000000}, // low out + { 10000, 50000, 80000, 150000, 300000, 1000000, 5000000, 30000000, 100000000, 180000000, 650000000, 700000000, 760000000, 780000000, 790000000, 800000000, 800000000, 800000000, 800000000, 800000000}, // low out }, .correction_value = { diff --git a/sa_core.c b/sa_core.c index 79d9eb2..8255f21 100644 --- a/sa_core.c +++ b/sa_core.c @@ -97,7 +97,7 @@ static freq_t real_old_freq[4] = { 0, 0, 0, 0}; #endif #ifdef TINYSA4 -const float si_drive_dBm [] = {-43.8, -30.0, -21.8, -17.2, -14.2, -11.9, -10.1, -8.6, -7.3, -6.2, -5.2, -4.3, -3.5, -2.8 , -2.2, -1.5, -1, -0.5, 0}; +const float si_drive_dBm [] = {-44.30, -29.98, -19.41, -16.80, -13.79, -11.49, -9.67, -8.18, -6.98, -5.87, -4.91, -4.16, -3.31, -2.62 , -1.99, -1.41, -0.95, -0.47, 0}; const float adf_drive_dBm[] = {-15,-12,-9,-6}; const uint8_t drive_register[] = {0, 1, 2, 3, 4, 5, 6, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}; float *drive_dBm = (float *) adf_drive_dBm; @@ -106,7 +106,7 @@ const int8_t drive_dBm [16] = {-38, -32, -30, -27, -24, -19, -15, -12, -5, -2, 0 #endif #ifdef TINYSA4 -#define SWITCH_ATTENUATION ((setting.mode == M_GENHIGH && config.high_out_adf4350) ? 40 : 23 - config.switch_offset) +#define SWITCH_ATTENUATION ((setting.mode == M_GENHIGH && config.high_out_adf4350) ? 40 : 25.0) #define RECEIVE_SWITCH_ATTENUATION (29 - config.receive_switch_offset) //#define POWER_OFFSET -18 // Max level with all enabled //#define POWER_RANGE 70 diff --git a/si4468.c b/si4468.c index 402736c..d80b9e2 100644 --- a/si4468.c +++ b/si4468.c @@ -1648,7 +1648,7 @@ static const RBW_t RBW_choices[] = {SI4463_RBW_850kHz, -9,8500, 8}, #else -#define NOISE_BASE_CORRECTION 10 +#define NOISE_BASE_CORRECTION 7 {SI4463_RBW_02kHz, 15,3, NOISE_BASE_CORRECTION + 10}, // 15 ->10 {SI4463_RBW_1kHz, 15,10, NOISE_BASE_CORRECTION + -5}, // 5 -> -5 {SI4463_RBW_3kHz, 10,30, NOISE_BASE_CORRECTION + -5}, // 0 ->-5 diff --git a/ui_sa.c b/ui_sa.c index d2a1ff2..5e0f2b9 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -790,7 +790,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_output_level_acb) if (old_offset == 100) old_offset = 0; float new_offset = uistat.value - (-25.0) + old_offset; // calculate offset based on difference between measured peak level and known peak level if (uistat.value == 100) new_offset = 100; - if ((new_offset > -5 && new_offset < 5) || new_offset == 100) { + if ((new_offset > -10 && new_offset < 10) || new_offset == 100) { config.low_level_output_offset = new_offset; config_save(); } @@ -1311,8 +1311,17 @@ static UI_FUNCTION_CALLBACK(menu_clearconfig_cb) if (uistat.value != 1234) return; clear_all_config_prop_data(); +#ifdef TINYSA4 +#define SCB_AIRCR_VECTKEYSTAT_LSB 16 +#define SCB_AIRCR_VECTKEYSTAT (0xFFFF << SCB_AIRCR_VECTKEYSTAT_LSB) +#define SCB_AIRCR_VECTKEY (0x05FA << SCB_AIRCR_VECTKEYSTAT_LSB) +#define SCB_AIRCR_SYSRESETREQ (1 << 2) + SCB->AIRCR = SCB_AIRCR_VECTKEY | SCB_AIRCR_SYSRESETREQ; + while(true); +#else reset_settings(M_LOW); ui_mode_normal(); +#endif } float nf_gain;