Add no audio agc

pull/139/head
erikkaashoek 10 months ago
parent 1e9c1874b8
commit aa78ccc1cd

@ -880,6 +880,7 @@ typedef struct config {
#endif
#ifdef TINYSA4
uint8_t hide_21MHz;
uint8_t no_audio_agc;
#endif
float sweep_voltage;
float switch_offset;

@ -4446,11 +4446,11 @@ again: // Spur redu
#endif
else if (get_sweep_frequency(ST_SPAN)<50000000 || max2871) { // When scanning less then 50MHz
if (actual_rbw_x10 <= 3000) {
freq_t shift = (max2871 ? 700000 : 0);
freq_t shift = (max2871 ? 0 : 0);
freq_t tf= ((lf - shift + actual_rbw_x10*1000) / TXCO_DIV3) * TXCO_DIV3;
if (tf + shift + actual_rbw_x10*1000 >= lf && tf + shift < lf + actual_rbw_x10*1000) // 10MHz
if (max2871)
ADF4351_R_counter(3); // To avoid PLL Loop shoulders at multiple of 10MHz
ADF4351_R_counter(1);
else
ADF4351_R_counter(-4); // To avoid PLL Loop shoulders at multiple of 10MHz
else {

@ -2136,15 +2136,19 @@ void SI4432_Listen(int s)
// SI4463_WAIT_CTS; // Wait for CTS
do {
uint8_t v = Si446x_readRSSI();
if (max < v) // Peak
max = v;
if (count > 1000) { // Decay
max -= 1;
count = 0;
} else
count++;
v = max - v;
DAC->DHR12R1 = dBm_to_volt[v] << 4; // Use DAC: CH1 and put 12 bit right aligned value
if (config.no_audio_agc) {
DAC->DHR12R1 = v << 4; // Use DAC: CH1 and put 12 bit right aligned value
} else {
if (max < v) // Peak
max = v;
if (count > 1000) { // Decay
max -= 1;
count = 0;
} else
count++;
v = max - v;
DAC->DHR12R1 = dBm_to_volt[v] << 4; // Use DAC: CH1 and put 12 bit right aligned value
}
} while(operation_requested == OP_NONE);
count = 0;
// dacPutChannelX(&DACD2, 0, 0);

16
ui.c

@ -2782,6 +2782,21 @@ static UI_FUNCTION_ADV_CALLBACK(menu_linear_averaging_acb)
ui_mode_normal();
}
static UI_FUNCTION_ADV_CALLBACK(menu_audio_agc_acb)
{
(void)data;
(void)item;
if (b){
b->icon = config.no_audio_agc ? BUTTON_ICON_NOCHECK : BUTTON_ICON_CHECK;
return;
}
config.no_audio_agc = ! config.no_audio_agc;
dirty = true;
config_save();
// menu_move_back();
ui_mode_normal();
}
#endif
@ -4941,6 +4956,7 @@ static const menuitem_t menu_settings[] =
{ MT_ADV_CALLBACK,0, "PROGRESS\nBAR", menu_progress_bar_acb},
{ MT_ADV_CALLBACK, 0, "DIRECT\nMODE", menu_direct_acb},
{ MT_ADV_CALLBACK, 0, "LINEAR\nAVERAGING", menu_linear_averaging_acb},
{ MT_ADV_CALLBACK, 0, "AUDIO\nAGC", menu_audio_agc_acb},
#ifdef __HARMONIC__
{ MT_SUBMENU ,0, "HARMONIC", menu_harmonic},
#endif

Loading…
Cancel
Save

Powered by TurnKey Linux.