]> sigrok.org Git - libsigrok.git/commitdiff
scpi-pps: Fix typos and minor cosmetics.
authorUwe Hermann <redacted>
Wed, 17 Apr 2019 15:42:18 +0000 (17:42 +0200)
committerUwe Hermann <redacted>
Wed, 17 Apr 2019 15:59:16 +0000 (17:59 +0200)
src/hardware/scpi-pps/api.c
src/hardware/scpi-pps/profiles.c

index 2ea124a12926e5ca022d854f6b2c7895649ad7a2..3d02b2cb040b00f2454471e5a01729447b3741d4 100644 (file)
@@ -153,7 +153,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi,
                                        ch = l->data;
                                        pch = ch->priv;
                                        /* Add mqflags from channel_group_spec only to voltage
-                                        * and current channels
+                                        * and current channels.
                                         */
                                        if (pch->mq == SR_MQ_VOLTAGE || pch->mq == SR_MQ_CURRENT)
                                                pch->mqflags = cgs->mqflags;
@@ -173,7 +173,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi,
        sr_scpi_hw_info_free(hw_info);
        hw_info = NULL;
 
-       /* Don't send SCPI_CMD_LOCAL for HP 66xxB devices using SCPI over GPIB */
+       /* Don't send SCPI_CMD_LOCAL for HP 66xxB using SCPI over GPIB. */
        if (!(devc->device->dialect == SCPI_DIALECT_HP_66XXB &&
                        scpi->transport == SCPI_TRANSPORT_LIBGPIB))
                sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_LOCAL);
@@ -269,7 +269,7 @@ static int dev_open(struct sr_dev_inst *sdi)
 
        devc = sdi->priv;
 
-       /* Don't send SCPI_CMD_REMOTE for HP 66xxB devices using SCPI over GPIB */
+       /* Don't send SCPI_CMD_REMOTE for HP 66xxB using SCPI over GPIB. */
        if (!(devc->device->dialect == SCPI_DIALECT_HP_66XXB &&
                        scpi->transport == SCPI_TRANSPORT_LIBGPIB))
                sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_REMOTE);
@@ -303,7 +303,7 @@ static int dev_close(struct sr_dev_inst *sdi)
                sr_scpi_cmd(sdi, devc->device->commands,
                        0, NULL, SCPI_CMD_BEEPER_ENABLE);
 
-       /* Don't send SCPI_CMD_LOCAL for HP 66xxB devices using SCPI over GPIB */
+       /* Don't send SCPI_CMD_LOCAL for HP 66xxB using SCPI over GPIB. */
        if (!(devc->device->dialect == SCPI_DIALECT_HP_66XXB &&
                        scpi->transport == SCPI_TRANSPORT_LIBGPIB))
                sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_LOCAL);
index c9e8632c7b0ed1001dcb122241c8edbce081be5f..d9f98d0a85a176271526a8ca2fb3cacf29523ce0 100644 (file)
@@ -486,7 +486,6 @@ static const struct scpi_command hp_6630a_cmd[] = {
 static int hp_6630a_init_acquisition(const struct sr_dev_inst *sdi)
 {
        struct sr_scpi_dev_inst *scpi;
-       int ret;
 
        scpi = sdi->conn;
 
@@ -494,11 +493,7 @@ static int hp_6630a_init_acquisition(const struct sr_dev_inst *sdi)
         * Monitor CV (1), CC+ (2), UR (4), OVP (8), OTP (16), OCP (64) and
         * CC- (256) bits of the Status Register for the FAULT? query.
         */
-       ret = sr_scpi_send(scpi, "UNMASK 607");
-       if (ret != SR_OK)
-               return ret;
-
-       return SR_OK;
+       return sr_scpi_send(scpi, "UNMASK 607");
 }
 
 static int hp_6630a_update_status(const struct sr_dev_inst *sdi)
@@ -553,7 +548,7 @@ static int hp_6630a_update_status(const struct sr_dev_inst *sdi)
        regulation_changed = (fault & (1 << 9)) | regulation_changed;
 
        if (regulation_changed) {
-               if (cv && !cc_pos && !cc_neg &&!unreg)
+               if (cv && !cc_pos && !cc_neg && !unreg)
                        regulation = "CV";
                else if (cc_pos && !cv && !cc_neg && !unreg)
                        regulation = "CC";
@@ -561,7 +556,7 @@ static int hp_6630a_update_status(const struct sr_dev_inst *sdi)
                        regulation = "CC-";
                else if (unreg && !cv && !cc_pos && !cc_neg)
                        regulation = "UR";
-               else if (!cv && !cc_pos && !cc_neg &&!unreg)
+               else if (!cv && !cc_pos && !cc_neg && !unreg)
                        regulation = "";
                else {
                        sr_dbg("Undefined regulation for HP 66xxA "
@@ -779,8 +774,8 @@ static int hp_6630b_update_status(const struct sr_dev_inst *sdi)
                /*
                 * Check if output state has changed, due to one of the
                 * questionable states changed.
-                * NOTE: The output state is send even if it hasn't changed, but that
-                * only happends rarely.
+                * NOTE: The output state is sent even if it hasn't changed,
+                * but that only happens rarely.
                 */
                ret = sr_scpi_get_bool(scpi, "OUTP:STAT?", &output_enabled);
                if (ret != SR_OK)
@@ -812,7 +807,7 @@ static int hp_6630b_update_status(const struct sr_dev_inst *sdi)
        }
 
        if (regulation_changed) {
-               if (cv && !cc_pos && !cc_neg &&!unreg)
+               if (cv && !cc_pos && !cc_neg && !unreg)
                        regulation = "CV";
                else if (cc_pos && !cv && !cc_neg && !unreg)
                        regulation = "CC";
@@ -820,11 +815,11 @@ static int hp_6630b_update_status(const struct sr_dev_inst *sdi)
                        regulation = "CC-";
                else if (unreg && !cv && !cc_pos && !cc_neg)
                        regulation = "UR";
-               else if (!cv && !cc_pos && !cc_neg &&!unreg)
-                       /* This happends in case of OCP active */
+               else if (!cv && !cc_pos && !cc_neg && !unreg)
+                       /* This happens in case of OCP active. */
                        regulation = "";
                else {
-                       /* This happends from time to time (CV and CC+ active). */
+                       /* This happens from time to time (CV and CC+ active). */
                        sr_dbg("Undefined regulation for HP 66xxB "
                                "(CV=%i, CC+=%i, CC-=%i, UR=%i).",
                                cv, cc_pos, cc_neg, unreg);