Drop at drive change solved

SI443_RBW_update
erikkaashoek 4 years ago
parent a8ac5c0044
commit 589c9a5a36

@ -980,9 +980,9 @@ config_t config = {
.high_level_output_offset = 0, // Uncalibrated, but checking code is not yet present .high_level_output_offset = 0, // Uncalibrated, but checking code is not yet present
.harmonic_level_offset = 7, .harmonic_level_offset = 7,
.shift_level_offset = -0.5, .shift_level_offset = -0.5,
.drive1_level_offset = -1, .drive1_level_offset = -1.5,
.drive2_level_offset = -2.5, .drive2_level_offset = -3,
.drive3_level_offset = -3, .drive3_level_offset = -3.5,
.correction_frequency = .correction_frequency =
{ {
{ 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low in { 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low in

@ -123,7 +123,7 @@ void update_grid(void)
if (config.gridlines < 3) if (config.gridlines < 3)
config.gridlines = 6; config.gridlines = 6;
while (gdigit > 10) { while (gdigit > 1) {
grid = 5 * gdigit; grid = 5 * gdigit;
if (fspan / grid >= config.gridlines) if (fspan / grid >= config.gridlines)
break; break;

@ -1802,7 +1802,29 @@ pureRSSI_t get_frequency_correction(freq_t f) // Frequency dependent RSSI c
#ifdef TINYSA4 #ifdef TINYSA4
if (setting.extra_lna) if (setting.extra_lna)
c += 1; c += 1;
if (setting.mode == M_LOW) { if (setting.mode == M_LOW) {
//
// ---------------- duplication of code
//
actual_drive = setting.lo_drive;
if (actual_drive & 0x04){ // Automatic mixer drive
if (LO_harmonic)
actual_drive = 3;
// else if (f < DRIVE0_MAX_FREQ) // below 600MHz
// actual_drive = 0;
else if (f < DRIVE1_MAX_FREQ) // below 1.2GHz
actual_drive = 1;
else if (f < DRIVE2_MAX_FREQ) // below 2GHz
actual_drive = 2;
else
actual_drive = 3;
}
//
// ----------------- end duplication of code
//
switch(actual_drive) { switch(actual_drive) {
case 1: case 1:
cv += float_TO_PURE_RSSI(config.drive1_level_offset); cv += float_TO_PURE_RSSI(config.drive1_level_offset);
@ -3808,12 +3830,16 @@ again: // Spur redu
} }
// ----------------------------- set mixer drive -------------------------------------------- // ----------------------------- set mixer drive --------------------------------------------
if (setting.mode == M_LOW) { if (setting.mode == M_LOW) {
//
// ----------------- start duplication of code
//
actual_drive = setting.lo_drive; actual_drive = setting.lo_drive;
if (actual_drive & 0x04){ // Automatic mixer drive if (actual_drive & 0x04){ // Automatic mixer drive
if (LO_harmonic) if (LO_harmonic)
actual_drive = 3; actual_drive = 3;
else if (lf < DRIVE0_MAX_FREQ) // below 600MHz // else if (lf < DRIVE0_MAX_FREQ) // below 600MHz
actual_drive = 0; // actual_drive = 0;
else if (lf < DRIVE1_MAX_FREQ) // below 1.2GHz else if (lf < DRIVE1_MAX_FREQ) // below 1.2GHz
actual_drive = 1; actual_drive = 1;
else if (lf < DRIVE2_MAX_FREQ) // below 2GHz else if (lf < DRIVE2_MAX_FREQ) // below 2GHz
@ -3821,6 +3847,9 @@ again: // Spur redu
else else
actual_drive = 3; actual_drive = 3;
} }
//
// ----------------- end duplication of code
//
if (old_drive != actual_drive) { if (old_drive != actual_drive) {
ADF4351_drive(actual_drive); // Max drive ADF4351_drive(actual_drive); // Max drive
old_drive = actual_drive; old_drive = actual_drive;

@ -510,6 +510,8 @@ void ADF4351_drive(int p)
// registers[4] &= ~(((uint32_t)0x3) << 3); // registers[4] &= ~(((uint32_t)0x3) << 3);
// registers[4] |= (((uint32_t) p) << 3); // registers[4] |= (((uint32_t) p) << 3);
ADF4351_Set(0); ADF4351_Set(0);
my_microsecond_delay(1000);
} }
void ADF4351_aux_drive(int p) void ADF4351_aux_drive(int p)

Loading…
Cancel
Save

Powered by TurnKey Linux.