]> sigrok.org Git - libsigrok.git/commitdiff
Sigma: Fix simple trigger LUT calculation.
authorHåvard Espeland <redacted>
Sun, 2 May 2010 10:59:33 +0000 (12:59 +0200)
committerHåvard Espeland <redacted>
Sun, 2 May 2010 11:00:41 +0000 (13:00 +0200)
hardware/asix-sigma/asix-sigma.c

index 64f637d48058fb1d50eac35ccea1c6f8c2c7a5e4..0dbd38eb744308e21b3515f9ff02d5438010597c 100644 (file)
@@ -932,22 +932,25 @@ static int build_basic_trigger(struct triggerlut *lut)
        lut->m4 = 0xa000;
 
        /* Set the LUT for controlling value/maske trigger */
+
+       /* For each quad probe. */
        for (i = 0; i < 4; ++i) {
                lut->m2d[i] = 0xffff;
 
+               /* For each bit in LUT. */
                for (j = 0; j < 16; ++j)
 
+                       /* For each probe in quad. */
                        for (k = 0; k < 4; ++k) {
                                bit = 1 << (i * 4 + k);
 
                                if ((triggermask & bit) &&
-                                   (triggervalue & bit) != (j & (1 << k))) {
+                                   ((!(triggervalue & bit)) !=
+                                    (!(j & (1 << k)))))
                                        lut->m2d[i] &= ~(1 << j);
-                               }
                        }
        }
 
-
        /* Unused when not triggering on transitions */
        lut->m3 = 0xffff;