mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2025-12-06 03:31:59 +01:00
fix delay on frequency change
This commit is contained in:
parent
c083fb9298
commit
7d7b752569
12
main.c
12
main.c
|
|
@ -397,12 +397,13 @@ void scan_lcd(void)
|
||||||
|
|
||||||
rewind:
|
rewind:
|
||||||
frequency_updated = FALSE;
|
frequency_updated = FALSE;
|
||||||
|
delay = 4;
|
||||||
|
|
||||||
delay = set_frequency(frequencies[0]);
|
|
||||||
delay += 2;
|
|
||||||
for (i = 0; i < sweep_points; i++) {
|
for (i = 0; i < sweep_points; i++) {
|
||||||
|
set_frequency(frequencies[i]);
|
||||||
tlv320aic3204_select_in3();
|
tlv320aic3204_select_in3();
|
||||||
wait_dsp(delay+2);
|
wait_dsp(delay);
|
||||||
|
|
||||||
// blink LED while scanning
|
// blink LED while scanning
|
||||||
palClearPad(GPIOC, GPIOC_LED);
|
palClearPad(GPIOC, GPIOC_LED);
|
||||||
|
|
||||||
|
|
@ -410,12 +411,11 @@ void scan_lcd(void)
|
||||||
calculate_gamma(measured[0][i]);
|
calculate_gamma(measured[0][i]);
|
||||||
|
|
||||||
tlv320aic3204_select_in1();
|
tlv320aic3204_select_in1();
|
||||||
wait_dsp(2+2);
|
wait_dsp(delay);
|
||||||
|
|
||||||
/* calculate transmission coeficient */
|
/* calculate transmission coeficient */
|
||||||
calculate_gamma(measured[1][i]);
|
calculate_gamma(measured[1][i]);
|
||||||
|
|
||||||
delay = set_frequency(frequencies[(i+1)%sweep_points]);
|
|
||||||
// blink LED while scanning
|
// blink LED while scanning
|
||||||
palSetPad(GPIOC, GPIOC_LED);
|
palSetPad(GPIOC, GPIOC_LED);
|
||||||
ui_process();
|
ui_process();
|
||||||
|
|
@ -427,8 +427,10 @@ void scan_lcd(void)
|
||||||
if (cal_status & CALSTAT_APPLY)
|
if (cal_status & CALSTAT_APPLY)
|
||||||
apply_error_term();
|
apply_error_term();
|
||||||
|
|
||||||
|
/* calculate trace coordinates */
|
||||||
plot_into_index(measured);
|
plot_into_index(measured);
|
||||||
|
|
||||||
|
/* plot trace as raster */
|
||||||
draw_cell_all();
|
draw_cell_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
si5351.c
2
si5351.c
|
|
@ -304,7 +304,7 @@ int
|
||||||
si5351_set_frequency_with_offset(int freq, int offset, uint8_t drive_strength)
|
si5351_set_frequency_with_offset(int freq, int offset, uint8_t drive_strength)
|
||||||
{
|
{
|
||||||
int band;
|
int band;
|
||||||
int delay = 3;
|
int delay = 5;
|
||||||
if (freq <= 100000000) {
|
if (freq <= 100000000) {
|
||||||
band = 0;
|
band = 0;
|
||||||
} else if (freq < 150000000) {
|
} else if (freq < 150000000) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue