]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hantek-6xxx/protocol.c
hantek-6xxx: Ignore requests to set Hantek 6022BE coupling.
[libsigrok.git] / src / hardware / hantek-6xxx / protocol.c
index 12a56ab9d09970589aa0fd1e25c46ed29ebc5cc2..a43f72bbb546247abcd8ce68cfce68c19478d501 100644 (file)
@@ -220,9 +220,13 @@ SR_PRIV int hantek_6xxx_update_coupling(const struct sr_dev_inst *sdi)
        struct dev_context *devc = sdi->priv;
        uint8_t coupling = 0xFF & ((devc->coupling[1] << 4) | devc->coupling[0]);
 
-       sr_dbg("update coupling 0x%x", coupling);
-
-       return write_control(sdi, COUPLING_REG, coupling);
+       if (devc->has_coupling) {
+               sr_dbg("update coupling 0x%x", coupling);
+               return write_control(sdi, COUPLING_REG, coupling);
+       } else {
+               sr_dbg("coupling not supported");
+               return SR_OK;
+       }
 }
 
 SR_PRIV int hantek_6xxx_update_channels(const struct sr_dev_inst *sdi)