From: Daniel Anselmi Date: Thu, 20 Jun 2019 12:19:57 +0000 (+0200) Subject: ipdbg-la: Fix an issue when capture rate is 100%. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=08ecb98e847f929bb0f412f79073f2262045a65b;p=libsigrok.git ipdbg-la: Fix an issue when capture rate is 100%. If the capture ratio was set to 100%, the delay counter-value has an overflow and a delay of 0 samples is used. This fixes bug #1393. --- diff --git a/src/hardware/ipdbg-la/protocol.c b/src/hardware/ipdbg-la/protocol.c index fc27f62d..df61b6ac 100644 --- a/src/hardware/ipdbg-la/protocol.c +++ b/src/hardware/ipdbg-la/protocol.c @@ -386,7 +386,7 @@ static int send_escaping(struct ipdbg_la_tcp *tcp, uint8_t *data_to_send, SR_PRIV int ipdbg_la_send_delay(struct dev_context *devc, struct ipdbg_la_tcp *tcp) { - devc->delay_value = (devc->limit_samples / 100.0) * devc->capture_ratio; + devc->delay_value = ((devc->limit_samples - 1) / 100.0) * devc->capture_ratio; uint8_t buf; buf = CMD_CFG_LA;