From: Wolfram Sang Date: Wed, 2 Jan 2019 12:15:16 +0000 (+0100) Subject: ols: use 32bit for handling sample counts X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=6e5a1a0178e24da5faf239dc78ab761d9f5af572;ds=sidebyside ols: use 32bit for handling sample counts The OLS protocol sends 16bit values to specify the sample count and delay count. However, this 16bit value is the number of 32bit words to be sampled, so the actual sample count is 4 times larger and does not fit into a uint16_t. Extend it to support the full range of 256K (LogicShrimp will need this) and to prepare support for devices with even more memory (Pepino). Signed-off-by: Wolfram Sang --- diff --git a/src/hardware/openbench-logic-sniffer/api.c b/src/hardware/openbench-logic-sniffer/api.c index fc0d9ebd..1aa7844e 100644 --- a/src/hardware/openbench-logic-sniffer/api.c +++ b/src/hardware/openbench-logic-sniffer/api.c @@ -396,7 +396,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_serial_dev_inst *serial; - uint16_t samplecount, readcount, delaycount; + uint32_t samplecount, readcount, delaycount; uint8_t ols_changrp_mask, arg[4]; int num_ols_changrp; int ret, i;