From: Uwe Hermann Date: Wed, 17 Apr 2019 15:42:18 +0000 (+0200) Subject: scpi-pps: Fix typos and minor cosmetics. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b89e6db910e4a38779fa033aa04040cb020d3fd2;p=libsigrok.git scpi-pps: Fix typos and minor cosmetics. --- diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index 2ea124a1..3d02b2cb 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -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); diff --git a/src/hardware/scpi-pps/profiles.c b/src/hardware/scpi-pps/profiles.c index c9e8632c..d9f98d0a 100644 --- a/src/hardware/scpi-pps/profiles.c +++ b/src/hardware/scpi-pps/profiles.c @@ -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);