1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-27 19:14:40 +02:00

ubb-la/ubb-la.c (do_buf): skip over the first 122 samples

They are from the setup process and therefore invalid (DAT0) and/or out
of sync (DAT0-3) with the rest of the samples.
This commit is contained in:
Werner Almesberger 2013-01-24 20:00:59 -03:00
parent fc4b8e720a
commit 4ce6866767

View File

@ -29,6 +29,8 @@
#define KEY_MASK 0x5fc0000 #define KEY_MASK 0x5fc0000
#define INITIAL_SKIP 122 /* should be 123 for higher speeds */
/* ----- Enable/disable interrupts ----------------------------------------- */ /* ----- Enable/disable interrupts ----------------------------------------- */
@ -181,7 +183,7 @@ static int do_buf(int nibbles, uint32_t trigger, uint32_t mask)
if (!xfer(vec.addr, nibbles, trigger, mask)) if (!xfer(vec.addr, nibbles, trigger, mask))
return 0; return 0;
for (i = 0; i != nibbles; i++) { for (i = INITIAL_SKIP; i != nibbles; i++) {
v = (buf[i >> 1] >> (4*(~i & 1))) & 0xf; v = (buf[i >> 1] >> (4*(~i & 1))) & 0xf;
if (v == last) { if (v == last) {
count++; count++;