Curve edit updated

pwm
erikkaashoek 3 years ago
parent 41afcfab5e
commit 7d9630aecd

@ -218,7 +218,7 @@ typedef uint32_t freq_t;
#define CORRECTION_LNA_ULTRA 3 #define CORRECTION_LNA_ULTRA 3
#define CORRECTION_DIRECT 4 #define CORRECTION_DIRECT 4
#define CORRECTION_LNA_DIRECT 5 #define CORRECTION_LNA_DIRECT 5
#define CORRECTION_LOW_OUT 6 #define CORRECTION_LOW_OUT 6 // Must be same order as output path options!!!!!
#define CORRECTION_LOW_OUT_DIRECT 7 #define CORRECTION_LOW_OUT_DIRECT 7
#define CORRECTION_LOW_OUT_ADF 8 #define CORRECTION_LOW_OUT_ADF 8
#define CORRECTION_LOW_OUT_MIXER 9 #define CORRECTION_LOW_OUT_MIXER 9
@ -1736,7 +1736,7 @@ extern void SI4432_Listen(int s);
// si4432.c // si4432.c
enum {PATH_OFF, PATH_LOW, PATH_DIRECT, PATH_LEAKAGE, PATH_ULTRA, PATH_HIGH}; enum {PATH_OFF, PATH_LOW, PATH_DIRECT, PATH_LEAKAGE, PATH_ULTRA, PATH_HIGH}; // must be same order as correction tables!!!!
#define PATH_TEXT {"OFF", "LOW", "DIRECT", "ADF", "ULTRA", "High"} #define PATH_TEXT {"OFF", "LOW", "DIRECT", "ADF", "ULTRA", "High"}
extern const char *path_text[]; extern const char *path_text[];
extern int signal_path; extern int signal_path;

54
ui.c

@ -1570,8 +1570,15 @@ static UI_FUNCTION_ADV_CALLBACK(menu_curve_acb)
} }
switch(current_curve) { switch(current_curve) {
case CORRECTION_LOW_OUT: case CORRECTION_LOW_OUT:
case CORRECTION_LOW_OUT_DIRECT:
case CORRECTION_LOW_OUT_ADF:
case CORRECTION_LOW_OUT_MIXER:
old_m = setting.mode; old_m = setting.mode;
reset_settings(M_GENLOW); reset_settings(M_GENLOW);
force_signal_path=true;
dirty = true;
test_output_drive = -1;
test_path = PATH_LOW + current_curve - CORRECTION_LOW_OUT; // This assumes the order is the SAME!!!!!
set_level(-35); set_level(-35);
set_sweep_frequency(ST_CW, config.correction_frequency[current_curve][data]); set_sweep_frequency(ST_CW, config.correction_frequency[current_curve][data]);
setting.mute = false; setting.mute = false;
@ -1718,6 +1725,36 @@ static UI_FUNCTION_CALLBACK(menu_output_curve_prepare_cb)
menu_push_submenu(menu_curve); menu_push_submenu(menu_curve);
} }
static UI_FUNCTION_CALLBACK(menu_output_ultra_curve_prepare_cb)
{
(void)item;
(void)data;
if (!output_is_calibrated())
return;
current_curve = CORRECTION_LOW_OUT_MIXER;
menu_push_submenu(menu_curve);
}
static UI_FUNCTION_CALLBACK(menu_output_direct_curve_prepare_cb)
{
(void)item;
(void)data;
if (!output_is_calibrated())
return;
current_curve = CORRECTION_LOW_OUT_DIRECT;
menu_push_submenu(menu_curve);
}
static UI_FUNCTION_CALLBACK(menu_output_adf_curve_prepare_cb)
{
(void)item;
(void)data;
if (!output_is_calibrated())
return;
current_curve = CORRECTION_LOW_OUT_ADF;
menu_push_submenu(menu_curve);
}
#endif #endif
static UI_FUNCTION_ADV_CALLBACK(menu_output_level_acb) static UI_FUNCTION_ADV_CALLBACK(menu_output_level_acb)
@ -1744,8 +1781,8 @@ static UI_FUNCTION_ADV_CALLBACK(menu_output_level_acb)
ui_mode_keypad(KM_LEVEL); ui_mode_keypad(KM_LEVEL);
if (kp_buf[0] != 0) { if (kp_buf[0] != 0) {
float old_offset = config.low_level_output_offset; float old_offset = config.low_level_output_offset;
if (!config.input_is_calibrated) old_offset = 0; // if (!config.input_is_calibrated) old_offset = 0;
float new_offset = uistat.value - (TEST_LEVEL) + old_offset; // calculate offset based on difference between measured peak level and known peak level volatile float new_offset = old_offset + (uistat.value - (TEST_LEVEL)); // calculate offset based on difference between measured peak level and known peak level
if (uistat.value == 100) { new_offset = 0; config.input_is_calibrated = false; } if (uistat.value == 100) { new_offset = 0; config.input_is_calibrated = false; }
if (new_offset > -15 && new_offset < 15) { if (new_offset > -15 && new_offset < 15) {
config.output_is_calibrated = true; config.output_is_calibrated = true;
@ -4090,11 +4127,14 @@ static const menuitem_t menu_actual_power[] =
{ MT_KEYPAD, KM_ACTUALPOWER, "INPUT\nLEVEL", "Enter actual level under marker"}, { MT_KEYPAD, KM_ACTUALPOWER, "INPUT\nLEVEL", "Enter actual level under marker"},
#ifdef TINYSA4 #ifdef TINYSA4
{ MT_SUBMENU, 0, "OUTPUT\nLEVEL", menu_actual_power2}, { MT_SUBMENU, 0, "OUTPUT\nLEVEL", menu_actual_power2},
{ MT_CALLBACK, 0, "INPUT\nCURVE", menu_input_curve_prepare_cb}, { MT_CALLBACK, 0, "IN\nCURVE", menu_input_curve_prepare_cb},
{ MT_CALLBACK, 0, "LNA\nCURVE", menu_lna_curve_prepare_cb}, { MT_CALLBACK, 0, "IN LNA\nCURVE", menu_lna_curve_prepare_cb},
{ MT_CALLBACK, 0, "ULTRA\nCURVE", menu_ultra_curve_prepare_cb}, { MT_CALLBACK, 0, "IN ULTRA\nCURVE", menu_ultra_curve_prepare_cb},
{ MT_CALLBACK, 0, "LNA_U\nCURVE", menu_lna_u_curve_prepare_cb}, { MT_CALLBACK, 0, "IN ULTRA\nLNA CURVE", menu_lna_u_curve_prepare_cb},
{ MT_CALLBACK, 0, "OUTPUT\nCURVE", menu_output_curve_prepare_cb}, { MT_CALLBACK, 0, "OUT\nCURVE", menu_output_curve_prepare_cb},
{ MT_CALLBACK, 0, "OUT DIR\nCURVE", menu_output_direct_curve_prepare_cb},
{ MT_CALLBACK, 0, "OUT ADF\nCURVE", menu_output_adf_curve_prepare_cb},
{ MT_CALLBACK, 0, "OUT MIXER\nCURVE", menu_output_ultra_curve_prepare_cb},
#else #else
{ MT_ADV_CALLBACK, 0, "OUTPUT\nLEVEL", menu_output_level_acb}, { MT_ADV_CALLBACK, 0, "OUTPUT\nLEVEL", menu_output_level_acb},
#endif #endif

Loading…
Cancel
Save

Powered by TurnKey Linux.