]> sigrok.org Git - libsigrok.git/commitdiff
dreamsourcelab-dslogic: Properly set initial voltage threshold.
authorUwe Hermann <redacted>
Sat, 28 Apr 2018 21:39:59 +0000 (23:39 +0200)
committerUwe Hermann <redacted>
Sat, 28 Apr 2018 21:39:59 +0000 (23:39 +0200)
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 <redacted>, thanks a lot!

src/hardware/dreamsourcelab-dslogic/api.c

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