aboutsummaryrefslogtreecommitdiffstats
path: root/emevent.c
blob: 0c086b1f06937774b888121b051df16eae9d48ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>

#define EVLEN 24

int main(int argc, char **argv)
{
    int i, c[24], last[8], diff;
    while(1){
        while(1){
            for(i=0; i<EVLEN; i++)
                c[i] = getchar();

            putchar('\n');
            for(i=0; i<8; i++)
                if(c[8+i] != last[i]){
                    diff = 1;
                    last[i] = c[8+i];
                }

            if(diff){
                printf("---- EVENT ----\n");
                diff = 0;
            }

            for(i=0; i<EVLEN; i++)
                printf("%2x", c[i]);
        }
    }
    return 0;
}