From 4ce686676792a490f3f8d6fa24c43d9b9ef21ab4 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 24 Jan 2013 20:00:59 -0300 Subject: [PATCH] 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. --- ubb-la/ubb-la.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ubb-la/ubb-la.c b/ubb-la/ubb-la.c index 28aef61..c63a023 100644 --- a/ubb-la/ubb-la.c +++ b/ubb-la/ubb-la.c @@ -29,6 +29,8 @@ #define KEY_MASK 0x5fc0000 +#define INITIAL_SKIP 122 /* should be 123 for higher speeds */ + /* ----- 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)) return 0; - for (i = 0; i != nibbles; i++) { + for (i = INITIAL_SKIP; i != nibbles; i++) { v = (buf[i >> 1] >> (4*(~i & 1))) & 0xf; if (v == last) { count++;