From: Ian Jackson Date: Sat, 12 Feb 2011 13:03:30 +0000 (+0000) Subject: wip support hatswitch properly, rather than as a valloc - abortive edits, one commit... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=efb2c1fced80d7bd8ed793a4361779c1cdd0c487;p=trains.git wip support hatswitch properly, rather than as a valloc - abortive edits, one commit only on this branch atm --- diff --git a/hostside/hidrawconv.c b/hostside/hidrawconv.c index 738a153..5e5bfa4 100644 --- a/hostside/hidrawconv.c +++ b/hostside/hidrawconv.c @@ -41,7 +41,10 @@ void reportlocs(const uint8_t msg[], const uint8_t last[], printf("%s %d\n", loc->str, loc->sign * (int8_t)mb); } } - + +void reporthat(const uint8_t msg[], const uint8_t last[], int len, + + static void events(void) { uint8_t msg[MAXREPORTLEN]; for (;;) { diff --git a/hostside/hidrawconv.h b/hostside/hidrawconv.h index 9e34f78..9f5a3ab 100644 --- a/hostside/hidrawconv.h +++ b/hostside/hidrawconv.h @@ -27,6 +27,17 @@ typedef struct { uint8_t mask, zero; } ValLoc; +typedef struct { + int x, y; +} HatPosn; + +typedef struct { + const char *base; + int pos, rshift, max; /* mask is applied before rshift */ + uint8_t mask; + const HatPosn[ +} HatLoc; + void reportbits(const uint8_t msg[], const uint8_t last[], int len, const KeyBit bits[]);