From: HÃ¥vard Espeland Date: Sun, 2 May 2010 10:59:33 +0000 (+0200) Subject: Sigma: Fix simple trigger LUT calculation. X-Git-Tag: libsigrok-0.1.0~533 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f758d0744de812ded8938d06a5a72df3f8dd84c1;p=libsigrok.git Sigma: Fix simple trigger LUT calculation. --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 64f637d4..0dbd38eb 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -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;