From: Paul Kasemir Date: Mon, 12 Dec 2022 23:57:28 +0000 (-0700) Subject: link-mso19: Make mso_calc_trigger_threshold() static X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=76ead02c265a0c34b0d2f42b3c823732c09ac1d6;p=libsigrok.git link-mso19: Make mso_calc_trigger_threshold() static It's only used in protocol.c so there's no need to export it. --- diff --git a/src/hardware/link-mso19/protocol.c b/src/hardware/link-mso19/protocol.c index 25660efb..724f7358 100644 --- a/src/hardware/link-mso19/protocol.c +++ b/src/hardware/link-mso19/protocol.c @@ -82,6 +82,19 @@ static uint16_t mso_bank_select(const struct dev_context *devc, int bank) return mso_trans(REG_CTL2, devc->ctlbase2 | BITS_CTL2_BANK(bank)); } +static uint16_t mso_calc_trigger_threshold(struct dev_context *devc) +{ + int threshold; + /* Trigger threshold is affected by the offset, so we need to add in + * the offset */ + threshold = devc->dso_trigger_adjusted + devc->dso_offset_adjusted; + /* A calibrated raw threshold is always sent in 1x voltage, so need to + * scale by probe factor and then by calibration vbit */ + threshold = threshold / devc->dso_probe_factor / devc->vbit; + + return (uint16_t) (TRIG_THRESH_START - threshold); +} + SR_PRIV int mso_configure_trigger(const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -178,19 +191,6 @@ SR_PRIV int mso_dac_out(const struct sr_dev_inst *sdi, uint16_t val) return mso_send_control_message(devc->serial, ARRAY_AND_SIZE(ops)); } -SR_PRIV uint16_t mso_calc_trigger_threshold(struct dev_context *devc) -{ - int threshold; - /* Trigger threshold is affected by the offset, so we need to add in - * the offset */ - threshold = devc->dso_trigger_adjusted + devc->dso_offset_adjusted; - /* A calibrated raw threshold is always sent in 1x voltage, so need to - * scale by probe factor and then by calibration vbit */ - threshold = threshold / devc->dso_probe_factor / devc->vbit; - - return (uint16_t) (TRIG_THRESH_START - threshold); -} - SR_PRIV int mso_parse_serial(const char *serial_num, const char *product, struct dev_context *devc) { diff --git a/src/hardware/link-mso19/protocol.h b/src/hardware/link-mso19/protocol.h index 487d7d2c..22b7082e 100644 --- a/src/hardware/link-mso19/protocol.h +++ b/src/hardware/link-mso19/protocol.h @@ -128,7 +128,6 @@ SR_PRIV int mso_read_buffer(struct sr_dev_inst *sdi); SR_PRIV int mso_arm(const struct sr_dev_inst *sdi); SR_PRIV int mso_force_capture(struct sr_dev_inst *sdi); SR_PRIV int mso_dac_out(const struct sr_dev_inst *sdi, uint16_t val); -SR_PRIV uint16_t mso_calc_trigger_threshold(struct dev_context *devc); SR_PRIV int mso_reset_fsm(const struct sr_dev_inst *sdi); SR_PRIV int mso_configure_channels(const struct sr_dev_inst *sdi);