From: Uwe Hermann Date: Wed, 10 Jan 2018 21:20:45 +0000 (+0100) Subject: hantek-dso: Capture ratio is a uint64_t. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d3f14af7ed07ba5b7e2c1af7c11614454021abbe;p=libsigrok.git hantek-dso: Capture ratio is a uint64_t. From src/hwdriver.c: {SR_CONF_CAPTURE_RATIO, SR_T_UINT64, "captureratio", "Pre-trigger capture ratio", NULL}, --- diff --git a/src/hardware/hantek-dso/protocol.c b/src/hardware/hantek-dso/protocol.c index 55a8f71a..39d87c44 100644 --- a/src/hardware/hantek-dso/protocol.c +++ b/src/hardware/hantek-dso/protocol.c @@ -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; diff --git a/src/hardware/hantek-dso/protocol.h b/src/hardware/hantek-dso/protocol.h index f6d4bc6d..21131613 100644 --- a/src/hardware/hantek-dso/protocol.h +++ b/src/hardware/hantek-dso/protocol.h @@ -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 */