]> sigrok.org Git - libsigrok.git/commitdiff
hantek-dso: Capture ratio is a uint64_t.
authorUwe Hermann <redacted>
Wed, 10 Jan 2018 21:20:45 +0000 (22:20 +0100)
committerUwe Hermann <redacted>
Thu, 11 Jan 2018 01:21:50 +0000 (02:21 +0100)
From src/hwdriver.c:

  {SR_CONF_CAPTURE_RATIO, SR_T_UINT64, "captureratio",
          "Pre-trigger capture ratio", NULL},

src/hardware/hantek-dso/protocol.c
src/hardware/hantek-dso/protocol.h

index 55a8f71adc7747b44e3a5c2ce838a33de8634663..39d87c4433bb316564e0cdff84df818b76c2f808 100644 (file)
@@ -373,7 +373,7 @@ static int dso2250_set_trigger_samplerate(const struct sr_dev_inst *sdi)
        memset(cmdstring, 0, sizeof(cmdstring));
        cmdstring[0] = CMD_2250_SET_TRIGGERPOS_AND_BUFFER;
 
-       sr_dbg("Capture ratio: %d.", devc->capture_ratio);
+       sr_dbg("Capture ratio: %" PRIu64 ".", devc->capture_ratio);
        trig = devc->capture_ratio;
        dso2250_set_triggerpos(trig,
                        devc->framesize != FRAMESIZE_SMALL, cmdstring, 2);
@@ -494,7 +494,7 @@ SR_PRIV int dso_set_trigger_samplerate(const struct sr_dev_inst *sdi)
        cmdstring[5] = (tmp >> 8) & 0xff;
 
        /* Horizontal trigger position */
-       sr_dbg("Capture ratio: %d.", devc->capture_ratio);
+       sr_dbg("Capture ratio: %" PRIu64 ".", devc->capture_ratio);
        tmp = 0x77fff + 0x8000 * devc->capture_ratio / 100;
        cmdstring[6] = tmp & 0xff;
        cmdstring[7] = (tmp >> 8) & 0xff;
index f6d4bc6d28c94573cba7977f85ade8c74800f908..21131613144c3d4dd82480c2ff26746720f9154e 100644 (file)
@@ -204,7 +204,7 @@ struct dev_context {
        gboolean filter[2];
        int triggerslope;
        char *triggersource;
-       int capture_ratio;
+       uint64_t capture_ratio;
        int triggermode;
 
        /* Frame transfer */