Update bandwidth string on change

pull/130/head
DiSlord 5 years ago
parent 7f34a93067
commit d3ad97c6a9

@ -82,9 +82,9 @@ static volatile vna_shellcmd_t shell_function = 0;
// Enable port command, used for debug
//#define ENABLE_PORT_COMMAND
// Enable si5351 timing command, used for debug
#define ENABLE_SI5351_TIMINGS
//#define ENABLE_SI5351_TIMINGS
// Enable i2c timing command, used for debug
#define ENABLE_I2C_TIMINGS
//#define ENABLE_I2C_TIMINGS
static void apply_CH0_error_term_at(int i);
static void apply_CH1_error_term_at(int i);
@ -933,6 +933,11 @@ bool sweep(bool break_on_operation, uint16_t sweep_mode)
return p_sweep == sweep_points;
}
void set_bandwidth(uint16_t bw_count){
config.bandwidth = bw_count&0xFF;
redraw_request|=REDRAW_FREQUENCY;
}
uint32_t get_bandwidth_frequency(uint16_t bw_freq){
return (AUDIO_ADC_FREQ/AUDIO_SAMPLES_COUNT)/(bw_freq+1);
}
@ -941,7 +946,7 @@ VNA_SHELL_FUNCTION(cmd_bandwidth)
{
if (argc != 1)
goto result;
config.bandwidth = my_atoui(argv[0])&0xFF;
set_bandwidth(my_atoui(argv[0]));
result:
shell_printf("bandwidth %d (%uHz)\r\n", config.bandwidth, get_bandwidth_frequency(config.bandwidth));
}

@ -113,6 +113,7 @@ enum stimulus_type {
void set_sweep_frequency(int type, uint32_t frequency);
uint32_t get_sweep_frequency(int type);
void set_bandwidth(uint16_t bw_count);
uint32_t get_bandwidth_frequency(uint16_t bw_freq);
double my_atof(const char *p);

@ -754,8 +754,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_bandwidth_acb)
b->p1.u = get_bandwidth_frequency(data);
return;
}
config.bandwidth = data;
draw_frequencies();
set_bandwidth(data);
draw_menu();
}

Loading…
Cancel
Save

Powered by TurnKey Linux.