]> sigrok.org Git - libsigrokdecode.git/commitdiff
decoder: accept skip count 0 (onewire_link, usb_signalling)
authorGerhard Sittig <redacted>
Sun, 24 Nov 2019 18:37:49 +0000 (19:37 +0100)
committerUwe Hermann <redacted>
Sun, 24 Nov 2019 19:41:54 +0000 (20:41 +0100)
A recent commit tightened the check for acceptable 'skip' sample counts.
This broke the onewire_link and usb_signalling decoders' test sequences,
which no longer pass with a minimum count of one. Relax the condition
and accept a count of zero. This breaks gpib again for low total sample
count option values, but this needs to get addressed differently.

type_decoder.c

index 454e7ea90deea3b0a89ecf1ba6b90aaad62978e4..c097c7fce5b94cb950d3cb03c0fb4e52371a0df2 100644 (file)
@@ -677,7 +677,7 @@ static int create_term_list(struct srd_decoder_inst *di,
                        term->type = SRD_TERM_SKIP;
                        term->num_samples_to_skip = num_samples_to_skip;
                        term->num_samples_already_skipped = 0;
-                       if (num_samples_to_skip < 1)
+                       if (num_samples_to_skip < 0)
                                term->type = SRD_TERM_ALWAYS_FALSE;
                } else {
                        srd_err("Term key is neither a string nor a number.");