Sigma: Never send empty packets.

This commit is contained in:
Håvard Espeland 2011-01-18 22:17:43 +01:00
parent afa8f8449a
commit abda62ced8
1 changed files with 7 additions and 5 deletions

View File

@ -922,11 +922,13 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
/* Send rest of the chunk to sigrok. */ /* Send rest of the chunk to sigrok. */
tosend = n - sent; tosend = n - sent;
packet.type = DF_LOGIC; if (tosend > 0) {
packet.length = tosend * sizeof(uint16_t); packet.type = DF_LOGIC;
packet.unitsize = 2; packet.length = tosend * sizeof(uint16_t);
packet.payload = samples + sent; packet.unitsize = 2;
session_bus(sigma->session_id, &packet); packet.payload = samples + sent;
session_bus(sigma->session_id, &packet);
}
*lastsample = samples[n - 1]; *lastsample = samples[n - 1];
} }