]> sigrok.org Git - libsigrok.git/commitdiff
korad-kaxxxxp: All received values are zero
authorGeorg Hofmann <redacted>
Tue, 13 Sep 2022 08:12:04 +0000 (10:12 +0200)
committerGerhard Sittig <redacted>
Tue, 13 Sep 2022 15:59:22 +0000 (17:59 +0200)
Commit 5dfa77b5 introduced a regression in korad_kaxxxxp_get_value().
Positive non-zero return values from command transmission made the
routine fail for every invocation. Fixup the error check and advance
to response reception, do provide the values retrieved from the PSU.

[ gsi: rephrase check, reword commit message ]

src/hardware/korad-kaxxxxp/protocol.c

index 3476367015fa0bdb049aace24979ba1bc46b7d5b..f98bf962e37d23960993fcc893d54c7369051547 100644 (file)
@@ -299,7 +299,7 @@ SR_PRIV int korad_kaxxxxp_get_value(struct sr_serial_dev_inst *serial,
                sr_err("Don't know how to query %d.", target);
                ret = SR_ERR;
        }
-       if (ret != SR_OK) {
+       if (ret < 0) {
                g_mutex_unlock(&devc->rw_mutex);
                return ret;
        }