Fixed a tiny bug in the driver for the DSLogic that set the initial voltage
threshold to an invalid value (1.5 instead of 1.4, yikes), which causes
sr_config_get to return SR_ERR_BUG when it's retrieved. It appears to have
come in at commit 1ee7074.
Pulseview doesn't appear to handle error returns from sr_config_get well at
all, and died printing only "std::exception" to the console.
This will teach me not to update my sigrok installation when I'm in the
middle of using it for something... D:
- James
diff --git a/src/hardware/dreamsourcelab-dslogic/api.c b/src/hardware/dreamsourcelab-dslogic/api.c
index f7dd7256..8a80dc4a 100644
--- a/src/hardware/dreamsourcelab-dslogic/api.c
+++ b/src/hardware/dreamsourcelab-dslogic/api.c
@@ -352,7 +352,7 @@ static int dev_open(struct sr_dev_inst *sdi)
}
if (devc->cur_threshold == 0.0)
- devc->cur_threshold = 1.5;
+ devc->cur_threshold = thresholds[1][0];
return SR_OK;
}
@@ -404,7 +404,10 @@ static int config_get(uint32_t key, GVariant **data,
if (!strcmp(devc->profile->model, "DSLogic")) {
if ((idx = std_double_tuple_idx_d0(devc->cur_threshold,
ARRAY_AND_SIZE(thresholds))) < 0)
- return SR_ERR_BUG;
+ {
+ idx = 1;
+ devc->cur_threshold=thresholds[idx][0];
+ }
*data = std_gvar_tuple_double(thresholds[idx][0],
thresholds[idx][1]);
} else {
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel