]> sigrok.org Git - libsigrok.git/commitdiff
manson-hcs-3xxx: enabled output guaranteed write
authorturboaffe <redacted>
Tue, 3 Jan 2017 11:06:32 +0000 (12:06 +0100)
committerUwe Hermann <redacted>
Sat, 19 Aug 2017 17:21:54 +0000 (19:21 +0200)
src/hardware/manson-hcs-3xxx/api.c

index c7991c31c2fdf21a52d09cb4f5997fc6b8c170fb..92240cea30dc78251f86c6b7dd7516f8c3a609c4 100644 (file)
@@ -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: