From 6e5a1a0178e24da5faf239dc78ab761d9f5af572 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 2 Jan 2019 13:15:16 +0100 Subject: [PATCH] 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 --- src/hardware/openbench-logic-sniffer/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;