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.
This commit is contained in:
Daniel Anselmi 2019-06-20 14:19:57 +02:00 committed by Uwe Hermann
parent bf6b9e7b16
commit 08ecb98e84
1 changed files with 1 additions and 1 deletions

View File

@ -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;