From: turboaffe Date: Tue, 3 Jan 2017 11:06:32 +0000 (+0100) Subject: manson-hcs-3xxx: enabled output guaranteed write X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=9520fd413490916c6f9655b80a7da651df994ab1;p=libsigrok.git manson-hcs-3xxx: enabled output guaranteed write --- diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c index c7991c31..92240cea 100644 --- a/src/hardware/manson-hcs-3xxx/api.c +++ b/src/hardware/manson-hcs-3xxx/api.c @@ -250,11 +250,15 @@ static int config_set(uint32_t key, GVariant *data, break; case SR_CONF_ENABLED: bval = g_variant_get_boolean(data); - if (bval == devc->output_enabled) /* Nothing to do. */ - break; - if ((hcs_send_cmd(sdi->conn, "SOUT%1d\r", !bval) < 0) || - (hcs_read_reply(sdi->conn, 1, devc->buf, sizeof(devc->buf)) < 0)) + + if (hcs_send_cmd(sdi->conn, "SOUT%1d\r", !bval) < 0) { + sr_err("Could not send SR_CONF_ENABLED command."); return SR_ERR; + } + if (hcs_read_reply(sdi->conn, 1, devc->buf, sizeof(devc->buf)) < 0) { + sr_err("Could not read SR_CONF_ENABLED reply."); + return SR_ERR; + } devc->output_enabled = bval; break; default: