Output mode settings menu to config

pull/34/head
erikkaashoek 3 years ago
parent ae4f693968
commit a42955399d

@ -112,7 +112,8 @@ int actual_drive = -1;
#ifdef TINYSA4
const float si_drive_dBm [] = {-44.1, -30, -21.6, -17, -14, -11.7, -9.9, -8.4, -7.1, -6, -5, -4.2, -3.4, -2.7 , -2.1, -1.5, -1, -0.47, 0};
const float adf_drive_dBm[] = {-13,-7.5,-4.2, 0};
//const float adf_drive_dBm[] = {-13,-7.5,-4.2, 0};
const float adf_drive_dBm[] = {-9, -4, 0, 0};
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 *) si_drive_dBm;
const int min_drive = 0;
@ -236,21 +237,29 @@ void set_output_path(freq_t f, float level)
if (signal_path == PATH_HIGH) {
return; //TODO setup high path
}
float ATTENUATION_RESERVE = 3.0;
if (setting.modulation == MO_AM)
ATTENUATION_RESERVE = 6.0;
// if (signal_path != PATH_LEAKAGE)
level += ATTENUATION_RESERVE;
float ATTENUATION_RESERVE = 3.0;
if (signal_path == PATH_LEAKAGE) {
ATTENUATION_RESERVE = 0;
}
else {
if (setting.modulation == MO_AM)
ATTENUATION_RESERVE = 6.0;
}
level += ATTENUATION_RESERVE;
float switch_atten = SWITCH_ATTENUATION;
if (signal_path == PATH_LEAKAGE)
#if 0
switch_atten = 44.0;
#else
#ifdef TINYSA4
switch_atten = 32.0;
#else
switch_atten = 31.0;
#endif
#endif
float a = level - level_max(); // convert to all settings maximum power output equals a = zero
if (a < -28 + BELOW_MAX_DRIVE(0)) { // Switch needed
if (a < -switch_atten + BELOW_MAX_DRIVE(0)) { // Switch needed
a = a + switch_atten;
setting.atten_step = true;
} else

@ -786,7 +786,12 @@ static UI_FUNCTION_ADV_CALLBACK(menu_output_level_acb)
}
int old_m = setting.mode;
reset_settings(M_GENLOW);
set_level(-25);
#ifdef TINYSA4
#define TEST_LEVEL -30
#else
#define TEST_LEVEL -25
#endif
set_level(TEST_LEVEL);
set_sweep_frequency(ST_CW, 30000000);
setting.mute = false;
perform(false, 0, 30000000, false);
@ -797,11 +802,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_output_level_acb)
if (kp_buf[0] != 0) {
float old_offset = config.low_level_output_offset;
if (old_offset == 100) old_offset = 0;
#ifdef TINYSA4
float new_offset = uistat.value - (-25.0) + old_offset; // calculate offset based on difference between measured peak level and known peak level
#else
float new_offset = uistat.value - (-25.0) + old_offset; // calculate offset based on difference between measured peak level and known peak level
#endif
float new_offset = uistat.value - (TEST_LEVEL) + 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 > -10 && new_offset < 10) || new_offset == 100) {
config.low_level_output_offset = new_offset;

Loading…
Cancel
Save

Powered by TurnKey Linux.