X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhantek-dso%2Fprotocol.c;h=d2101f2a8170c892af1311c7a0e12f482aa3d84e;hb=821266e8ed4116e08f2a64561cc570c47b5a4b40;hp=39d87c4433bb316564e0cdff84df818b76c2f808;hpb=d3f14af7ed07ba5b7e2c1af7c11614454021abbe;p=libsigrok.git diff --git a/src/hardware/hantek-dso/protocol.c b/src/hardware/hantek-dso/protocol.c index 39d87c44..d2101f2a 100644 --- a/src/hardware/hantek-dso/protocol.c +++ b/src/hardware/hantek-dso/protocol.c @@ -130,7 +130,9 @@ SR_PRIV int dso_open(struct sr_dev_inst *sdi) /* * Check device by its physical USB bus/port address. */ - usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); + if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0) + continue; + if (strcmp(sdi->connection_id, connection_id)) /* This is not the one. */ continue; @@ -324,7 +326,8 @@ static int dso2250_set_trigger_samplerate(const struct sr_dev_inst *sdi) } tmp = base / devc->samplerate; - if (tmp) { + /* Downsample only if really necessary */ + if (tmp > 1) { /* Downsampling on */ cmdstring[2] |= 2; /* Downsampler = 1comp((Base / Samplerate) - 2)