rigol-ds: fix search for the closest vdiv.
We try to find the smallest diff by comparing each diff with the previously known smallest diff, so initially, this smallest diff should be INFINITY so that we are sure to find a smaller one. This fixes the following exception: sr: rigol-ds: Negative vdiv index: -1. Caught exception: not applicable
This commit is contained in:
parent
f44f7e61a3
commit
c33ff3771b
|
@ -502,7 +502,7 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
|
||||||
const char *tmp_str;
|
const char *tmp_str;
|
||||||
uint64_t samplerate;
|
uint64_t samplerate;
|
||||||
int analog_channel = -1;
|
int analog_channel = -1;
|
||||||
float smallest_diff = 0.0000000001;
|
float smallest_diff = INFINITY;
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue