mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2025-12-06 03:31:59 +01:00
Merge branch 'scan_delay_optimize'
This commit is contained in:
commit
f68997b832
8
main.c
8
main.c
|
|
@ -269,6 +269,8 @@ const int8_t gain_table[] = {
|
|||
95 // 1400MHz ~
|
||||
};
|
||||
|
||||
#define DELAY_GAIN_CHANGE 10
|
||||
|
||||
static int
|
||||
adjust_gain(int newfreq)
|
||||
{
|
||||
|
|
@ -277,7 +279,7 @@ adjust_gain(int newfreq)
|
|||
int old_order = frequency / FREQ_HARMONICS;
|
||||
if (new_order != old_order) {
|
||||
tlv320aic3204_set_gain(gain_table[new_order], gain_table[new_order]);
|
||||
delay += 10;
|
||||
delay += DELAY_GAIN_CHANGE;
|
||||
}
|
||||
return delay;
|
||||
}
|
||||
|
|
@ -655,6 +657,8 @@ ensure_edit_config(void)
|
|||
cal_status = 0;
|
||||
}
|
||||
|
||||
#define DELAY_CHANNEL_CHANGE 1
|
||||
|
||||
// main loop for measurement
|
||||
bool sweep(bool break_on_operation)
|
||||
{
|
||||
|
|
@ -672,7 +676,7 @@ bool sweep(bool break_on_operation)
|
|||
(*sample_func)(measured[0][i]);
|
||||
|
||||
tlv320aic3204_select_in1(); // CH1:TRANSMISSION
|
||||
wait_dsp(delay);
|
||||
wait_dsp(delay + DELAY_CHANNEL_CHANGE);
|
||||
|
||||
/* calculate transmission coeficient */
|
||||
(*sample_func)(measured[1][i]);
|
||||
|
|
|
|||
10
si5351.c
10
si5351.c
|
|
@ -296,6 +296,10 @@ si5351_set_frequency(int channel, int freq, uint8_t drive_strength)
|
|||
|
||||
int current_band = -1;
|
||||
|
||||
#define DELAY_NORMAL 2
|
||||
#define DELAY_BANDCHANGE 1
|
||||
#define DELAY_LOWBAND 1
|
||||
|
||||
/*
|
||||
* configure output as follows:
|
||||
* CLK0: frequency + offset
|
||||
|
|
@ -307,7 +311,7 @@ int
|
|||
si5351_set_frequency_with_offset(uint32_t freq, int offset, uint8_t drive_strength)
|
||||
{
|
||||
int band;
|
||||
int delay = 3;
|
||||
int delay = DELAY_NORMAL;
|
||||
uint32_t ofreq = freq + offset;
|
||||
uint32_t rdiv = SI5351_R_DIV_1;
|
||||
if (freq >= config.harmonic_freq_threshold * 3) {
|
||||
|
|
@ -389,8 +393,10 @@ si5351_set_frequency_with_offset(uint32_t freq, int offset, uint8_t drive_streng
|
|||
#if 1
|
||||
si5351_enable_output();
|
||||
#endif
|
||||
delay += 10;
|
||||
delay += DELAY_BANDCHANGE;
|
||||
}
|
||||
if (band == 0)
|
||||
delay += DELAY_LOWBAND;
|
||||
|
||||
current_band = band;
|
||||
return delay;
|
||||
|
|
|
|||
Loading…
Reference in a new issue