Clean output switch added

pull/34/head
erikkaashoek 4 years ago
parent bcc04d1536
commit ba756ede93

@ -18,7 +18,7 @@
*/ */
#include "ch.h" #include "ch.h"
#ifdef TINYSA_F303 //#ifdef TINYSA_F303
#ifdef TINYSA_F072 #ifdef TINYSA_F072
#error "Remove comment for #ifdef TINYSA_F303" #error "Remove comment for #ifdef TINYSA_F303"
#endif #endif
@ -26,7 +26,7 @@
#define TINYSA4 #define TINYSA4
#endif #endif
#define TINYSA4_PROTO #define TINYSA4_PROTO
#endif //#endif
#ifdef TINYSA_F072 #ifdef TINYSA_F072
#ifdef TINYSA_F303 #ifdef TINYSA_F303
@ -1184,6 +1184,7 @@ typedef struct setting
int R; // KM_R int R; // KM_R
int32_t exp_aver; int32_t exp_aver;
bool increased_R; bool increased_R;
bool clean_output;
#endif #endif
int64_t test_argument; // used for tests int64_t test_argument; // used for tests
uint32_t checksum; // must be last and at 4 byte boundary uint32_t checksum; // must be last and at 4 byte boundary

@ -3025,7 +3025,7 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
int modulation_count_iter = 0; int modulation_count_iter = 0;
int spur_second_pass = false; int spur_second_pass = false;
#ifdef __NEW_SWITCHES__ #ifdef __NEW_SWITCHES__
int direct = ((setting.mode == M_LOW && config.direct && f > DIRECT_START && f<DIRECT_STOP) || (setting.mode == M_GENLOW && f >= MINIMUM_DIRECT_FREQ && f < ultra_start) ); int direct = ((setting.mode == M_LOW && config.direct && f > DIRECT_START && f<DIRECT_STOP) || (setting.mode == M_GENLOW && f >= MINIMUM_DIRECT_FREQ && f < ultra_start && setting.clean_output) );
#else #else
const int direct = false; const int direct = false;
#endif #endif
@ -3441,7 +3441,7 @@ modulation_again:
#endif #endif
} }
} else if (setting.mode == M_GENLOW) { } else if (setting.mode == M_GENLOW) {
if (ultra && f > ultra_start) { // Ultra mode output using both SI and ADF if (ultra && (f > ultra_start || (!setting.clean_output && f > 800000000))) { // Ultra mode output using both SI and ADF
if (!SI4463_is_in_tx_mode()) if (!SI4463_is_in_tx_mode())
SI4463_init_tx(); SI4463_init_tx();
enable_ADF_output(true); enable_ADF_output(true);

@ -563,6 +563,7 @@ static const menuitem_t menu_measure_noise_figure[];
#endif #endif
static const menuitem_t menu_sweep[]; static const menuitem_t menu_sweep[];
static const menuitem_t menu_settings[]; static const menuitem_t menu_settings[];
static const menuitem_t menu_lowoutput_settings[];
extern bool dirty; extern bool dirty;
char range_text[20]; char range_text[20];
@ -1010,7 +1011,30 @@ static UI_FUNCTION_ADV_CALLBACK(menu_listen_acb)
#endif #endif
} }
#endif #endif
#ifdef TINYSA4
static UI_FUNCTION_ADV_CALLBACK(menu_lowoutput_settings_acb)
{
(void)item;
if (b){
if (data == 255) { b->param_1.text = setting.clean_output ? "CLEAN" : "ACCURATE"; return; }
b->icon = data == setting.clean_output ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
return;
}
switch(data) {
case 255:
menu_push_submenu(menu_lowoutput_settings);
return;
case 0:
setting.clean_output = false;
break;
case 1:
setting.clean_output = true;
break;
}
menu_move_back(false);
}
#endif
// const int menu_modulation_value[]={MO_NONE,MO_AM, MO_NFM, MO_WFM, MO_EXTERNAL}; // const int menu_modulation_value[]={MO_NONE,MO_AM, MO_NFM, MO_WFM, MO_EXTERNAL};
const char *menu_modulation_text[]={"None", "AM", "NFM", "WFM", "External"}; const char *menu_modulation_text[]={"None", "AM", "NFM", "WFM", "External"};
@ -2484,6 +2508,14 @@ static const menuitem_t menu_sweep[] = {
{ MT_FORM | MT_SUBMENU, 0, "SWEEP POINTS", menu_sweep_points_form}, { MT_FORM | MT_SUBMENU, 0, "SWEEP POINTS", menu_sweep_points_form},
{ MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
}; };
#ifdef TINYSA4
static const menuitem_t menu_lowoutput_settings[] = {
{ MT_FORM | MT_ADV_CALLBACK, 1, "OPTIMIZE FOR CLEAN SIGNAL", menu_lowoutput_settings_acb},
{ MT_FORM | MT_ADV_CALLBACK, 0, "OPTIMIZE FOR ACCURATE SIGNAL", menu_lowoutput_settings_acb},
{ MT_FORM | MT_SUBMENU, 255, S_RARROW" Settings", menu_settings},
{ MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
};
#endif
char low_level_help_text[12] = "-76..-6"; char low_level_help_text[12] = "-76..-6";
char center_text[18] = "FREQ: %s"; char center_text[18] = "FREQ: %s";
@ -2500,7 +2532,7 @@ const menuitem_t menu_lowoutputmode[] = {
#endif #endif
{ MT_FORM | MT_KEYPAD, KM_EXT_GAIN, "EXTERNAL GAIN: %s", "-100..+100"}, { MT_FORM | MT_KEYPAD, KM_EXT_GAIN, "EXTERNAL GAIN: %s", "-100..+100"},
#ifdef TINYSA4 #ifdef TINYSA4
{ MT_FORM | MT_SUBMENU, 255, S_RARROW" Settings", menu_settings}, { MT_FORM | MT_ADV_CALLBACK, 255, "OPTIMIZE: %s", menu_lowoutput_settings_acb},
#endif #endif
{ MT_FORM | MT_CANCEL, 0, "MODE", NULL }, { MT_FORM | MT_CANCEL, 0, "MODE", NULL },
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel

Loading…
Cancel
Save

Powered by TurnKey Linux.