]> sigrok.org Git - libsigrok.git/commitdiff
Sigma: Never send empty packets.
authorHåvard Espeland <redacted>
Tue, 18 Jan 2011 21:17:43 +0000 (22:17 +0100)
committerHåvard Espeland <redacted>
Tue, 18 Jan 2011 21:17:43 +0000 (22:17 +0100)
hardware/asix-sigma/asix-sigma.c

index abae17a0127ca9552d7ea3715c616a5489f2626d..bcf96422ef99f585a1a6ed8e889b176779a895c5 100644 (file)
@@ -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];
        }