dreamsourcelab-dslogic: Properly set initial voltage threshold.

The initial voltage threshold in dev_open() was being set to a
default value in the devc->cur_threshold variable but not actually set
in the device itself.

Patch by Jörg Alpers <jalpers@gmx.net>, thanks a lot!
This commit is contained in:
Uwe Hermann 2018-04-28 23:39:59 +02:00
parent 8a14fc0828
commit 55bcd7ad45
1 changed files with 3 additions and 1 deletions

View File

@ -360,8 +360,10 @@ static int dev_open(struct sr_dev_inst *sdi)
devc->cur_samplerate = devc->samplerates[0]; devc->cur_samplerate = devc->samplerates[0];
} }
if (devc->cur_threshold == 0.0) if (devc->cur_threshold == 0.0) {
devc->cur_threshold = thresholds[1][0]; devc->cur_threshold = thresholds[1][0];
return dslogic_set_voltage_threshold(sdi, devc->cur_threshold);
}
return SR_OK; return SR_OK;
} }