X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhantek-6xxx%2Fprotocol.c;h=a43f72bbb546247abcd8ce68cfce68c19478d501;hb=364b09c2a936fd7e98a879c3532fcd2fee4c1e0a;hp=12a56ab9d09970589aa0fd1e25c46ed29ebc5cc2;hpb=cc5ebc8a3d66e15ade82475ae890e0dafe9b4586;p=libsigrok.git diff --git a/src/hardware/hantek-6xxx/protocol.c b/src/hardware/hantek-6xxx/protocol.c index 12a56ab9..a43f72bb 100644 --- a/src/hardware/hantek-6xxx/protocol.c +++ b/src/hardware/hantek-6xxx/protocol.c @@ -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)