X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fkingst-la2016%2Fprotocol.c;fp=src%2Fhardware%2Fkingst-la2016%2Fprotocol.c;h=8748980a5d90cd8839d8cfb2254597158eb16cb8;hb=4c1bfdf3e9cca9e0ee61bd8ed4925fc5cac14fc5;hp=472fca7298270331c110c15fdcc48397ff1a76b9;hpb=68321f73b924b0392c3a738f82e92374d448b9a8;p=libsigrok.git diff --git a/src/hardware/kingst-la2016/protocol.c b/src/hardware/kingst-la2016/protocol.c index 472fca72..8748980a 100644 --- a/src/hardware/kingst-la2016/protocol.c +++ b/src/hardware/kingst-la2016/protocol.c @@ -1461,30 +1461,15 @@ static void stream_data(struct sr_dev_inst *sdi, /* TODO Add soft trigger support when in stream mode? */ - /* - * TODO Are memory cells always as wide as the channel count? - * Are they always 16bits wide? Verify for 32 channel devices. - */ - bit_count = devc->model->channel_count; - if (bit_count == 32) { - data_length /= sizeof(uint32_t); - } else if (bit_count == 16) { - data_length /= sizeof(uint16_t); - } else { - /* - * Unhandled case. Acquisition should not start. - * The statement silences the compiler. - */ - return; - } + /* All channels' chunks carry 16 samples for one channel. */ + bit_count = 16; + data_length /= sizeof(uint16_t); + rp = data_buffer; sample_value = 0; while (data_length--) { /* Get another entity. */ - if (bit_count == 32) - sample_value = read_u32le_inc(&rp); - else if (bit_count == 16) - sample_value = read_u16le_inc(&rp); + sample_value = read_u16le_inc(&rp); /* Map the entity's bits to a channel's samples. */ ch_mask = stream->channel_masks[stream->channel_index];