X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fhantek-6xxx%2Fprotocol.c;h=12a56ab9d09970589aa0fd1e25c46ed29ebc5cc2;hb=15a5bfe4815f9991a9bb532c05d6244a1818a0e4;hp=c02aa174647bb8168f1cc5f7e41f8dfacd6a0005;hpb=8d6d7d5d0db6c0a778af6b2db8c144630f85311e;p=libsigrok.git diff --git a/src/hardware/hantek-6xxx/protocol.c b/src/hardware/hantek-6xxx/protocol.c index c02aa174..12a56ab9 100644 --- a/src/hardware/hantek-6xxx/protocol.c +++ b/src/hardware/hantek-6xxx/protocol.c @@ -215,6 +215,16 @@ SR_PRIV int hantek_6xxx_update_vdiv(const struct sr_dev_inst *sdi) return MIN(ret1, ret2); } +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); +} + SR_PRIV int hantek_6xxx_update_channels(const struct sr_dev_inst *sdi) { struct dev_context *devc = sdi->priv; @@ -230,6 +240,7 @@ SR_PRIV int hantek_6xxx_init(const struct sr_dev_inst *sdi) hantek_6xxx_update_samplerate(sdi); hantek_6xxx_update_vdiv(sdi); + hantek_6xxx_update_coupling(sdi); // hantek_6xxx_update_channels(sdi); /* Only 2 channel mode supported. */ return SR_OK;