]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/kingst-la2016/protocol.c
kingst-la2016: adjust config param checks, threshold range check
[libsigrok.git] / src / hardware / kingst-la2016 / protocol.c
index 3f9156c49b29c3c47c9500d8eb56bce59d173e67..dc1a24a5193b6f0a96933e9f15443480b0eb2c5b 100644 (file)
@@ -344,10 +344,10 @@ static int set_threshold_voltage(const struct sr_dev_inst *sdi, float voltage)
        devc = sdi->priv;
 
        /* Clamp threshold setting to valid range for LA2016. */
-       if (voltage > 4.0) {
-               voltage = 4.0;
-       } else if (voltage < -4.0) {
-               voltage = -4.0;
+       if (voltage > LA2016_THR_VOLTAGE_MAX) {
+               voltage = LA2016_THR_VOLTAGE_MAX;
+       } else if (voltage < -LA2016_THR_VOLTAGE_MAX) {
+               voltage = -LA2016_THR_VOLTAGE_MAX;
        }
 
        /*