From: HÃ¥vard Espeland Date: Tue, 18 Jan 2011 21:17:43 +0000 (+0100) Subject: Sigma: Never send empty packets. X-Git-Tag: libsigrok-0.1.0~411 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=abda62ced8a9cdbb13be49a503d6bc6a8a8f8f2e;p=libsigrok.git Sigma: Never send empty packets. --- 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]; }