pull/96/head
erikkaashoek 2 years ago committed by Bohdan Kmit
parent 3902c722b9
commit a7e8a6402d

@ -2125,12 +2125,13 @@ typedef struct version_t {
const uint16_t hwid;
} version_t;
#define MAX_VERSION_TEXT 3
#define MAX_VERSION_TEXT 4
const version_t hw_version_text[MAX_VERSION_TEXT] =
{
{ 165, 179, "V0.4.5.1", 1},
{ 180, 195, "V0.4.5.1.1", 2},
{ 2030, 2050, "V0.5.2", 102},
{ 2051, 2500, "V0.5.3", 103},
};
uint16_t hwid = 0;
@ -3043,7 +3044,9 @@ int main(void)
memcpy(config.correction_value, v5_2_correction_value, sizeof(config.correction_value));
config.harmonic_level_offset = v5_2_harmonic_level_offset;
config.harmonic_lna_level_offset = v5_2_harmonic_lna_level_offset;
ULTRA_MAX_FREQ = 7300000000ULL;
if (hwid >= 103)
config.frequency_IF1 = DEFAULT_IF_PLUS;
ULTRA_MAX_FREQ = 7300000000ULL;
} else {
ULTRA_MAX_FREQ = 5340000000ULL;
}

@ -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
@ -154,6 +154,7 @@
#define FREQ_MULTIPLIER 100 // Multiplier of the 30MHz reference to get accurate frequency correction
#define VARIANT(X,Y) (Y)
#define DEFAULT_IF ((freq_t)977400000)
#define DEFAULT_IF_PLUS ((freq_t)1070000000)
#define DEFAULT_SPUR_OFFSET ((freq_t)(actual_rbw_x10 > 3000 ? 1500000 : 1000000))
#define STATIC_DEFAULT_SPUR_OFFSET ((freq_t) 1500000)
#define DEFAULT_MAX_FREQ ((freq_t) 800000000)

@ -3060,6 +3060,7 @@ static const freq_t spur_table[] = // Frequenci
const int spur_table_size = (sizeof spur_table)/sizeof(freq_t);
#endif
#ifdef TINYSA4
#define static_spur_IF DEFAULT_IF // The IF frequency for which the spur table is value
#define STATIC_SPUR_TABLE_SIZE 56
static const freq_t static_spur_table[STATIC_SPUR_TABLE_SIZE] = // Valid for IF=977.4MHz
{
@ -3121,6 +3122,71 @@ static const freq_t static_spur_table[STATIC_SPUR_TABLE_SIZE] = // Valid fo
797216000,
};
#define CALCULATED_SPUR_TABLE_SIZE = sizeof(static_spur_table)/8
#define static_spur_IF_plus DEFAULT_IF_PLUS // The IF frequency for which the spur table is value
static const freq_t static_spur_table_plus[] = // Valid for IF=977.4MHz
{
5233000,
6300000,
16483000,
16783000,
21300000,
26134000,
36300000,
41134000,
51300000,
66000000,
66300000,
70800000,
72000000,
78000000,
85200000,
101134000,
113134000,
114000000,
115200000,
243881127,
471300000,
487750054,
487762254,
501300000,
508800000,
650974672,
688800000,
699667000,
702865000,
703094000,
703465000,
706616000,
707216000,
708667000,
710366000,
710966000,
711667000,
711667000,
714115000,
714668000,
718465000,
718800000,
721616000,
722216000,
726300000,
729715000,
732865000,
738667000,
740366000,
740966000,
741667000,
747865000,
756667000,
759116000,
793465000,
797216000,
};
#define STATIC_SPUR_TABLE_SIZE_PLUS sizeof(static_spur_table_plus)/8
#define MAX_DYNAMIC_SPUR_TABLE_SIZE 100
static freq_t dynamic_spur_table[MAX_DYNAMIC_SPUR_TABLE_SIZE]; // Frequencies to be calculated
static int dynamic_spur_table_size = 0;
@ -3128,6 +3194,7 @@ static int always_use_dynamic_table = false;
static freq_t *spur_table = (freq_t *)static_spur_table;
int spur_table_size = STATIC_SPUR_TABLE_SIZE;
freq_t spur_IF = static_spur_IF;
#endif
@ -3220,8 +3287,15 @@ void fill_spur_table(void)
return;
}
if (actual_rbw_x10 < RBW_FOR_STATIC_TABLE) { // if less then 1100kHz use static table
spur_table = (freq_t *)static_spur_table;
spur_table_size = STATIC_SPUR_TABLE_SIZE;
if (hwid >= 103) {
spur_table = (freq_t *)static_spur_table_plus;
spur_table_size = STATIC_SPUR_TABLE_SIZE_PLUS;
spur_IF = static_spur_IF_plus;
} else {
spur_table = (freq_t *)static_spur_table;
spur_table_size = STATIC_SPUR_TABLE_SIZE;
spur_IF = static_spur_IF;
}
return;
}
if (!setting.auto_IF)
@ -4068,7 +4142,7 @@ again: // Spur redu
{
#ifdef TINYSA4
if (actual_rbw_x10 < RBW_FOR_STATIC_TABLE && setting.mode == M_LOW && lf > static_spur_table[0] - RBW_FOR_STATIC_TABLE * 100)
local_IF = 977400000; // static spur table IF
local_IF = spur_IF; // static spur table IF
else
local_IF = config.frequency_IF1;
#if 0

Loading…
Cancel
Save

Powered by TurnKey Linux.