From abda62ced8a9cdbb13be49a503d6bc6a8a8f8f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Espeland?= Date: Tue, 18 Jan 2011 22:17:43 +0100 Subject: [PATCH] Sigma: Never send empty packets. --- hardware/asix-sigma/asix-sigma.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index abae17a0..bcf96422 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -922,11 +922,13 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, /* Send rest of the chunk to sigrok. */ tosend = n - sent; - packet.type = DF_LOGIC; - packet.length = tosend * sizeof(uint16_t); - packet.unitsize = 2; - packet.payload = samples + sent; - session_bus(sigma->session_id, &packet); + if (tosend > 0) { + packet.type = DF_LOGIC; + packet.length = tosend * sizeof(uint16_t); + packet.unitsize = 2; + packet.payload = samples + sent; + session_bus(sigma->session_id, &packet); + } *lastsample = samples[n - 1]; }