+SR_PRIV int set_voltage_threshold(struct dev_context *devc, double thresh)
+{
+ if (thresh > 6.0)
+ thresh = 6.0;
+ if (thresh < -6.0)
+ thresh = -6.0;
+
+ devc->cur_threshold = thresh;
+
+ analyzer_set_voltage_threshold((int) round(-9.1*thresh + 62.6));
+
+ sr_info("Setting voltage threshold to %fV.", devc->cur_threshold);
+
+ return SR_OK;
+}
+