chiark / gitweb /
hostside: hidrawconv: declarations for hatswitches; impl'n is still no-op
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 12 Feb 2011 13:03:30 +0000 (13:03 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 20 Feb 2011 14:11:52 +0000 (14:11 +0000)
hostside/hidrawconv.c
hostside/hidrawconv.h

index 622e2ce7e73de66af38b67788f17e6cd17219a1a..bbb1edc10c753ddd1ae1f4f89faec34874edf643 100644 (file)
@@ -76,6 +76,10 @@ DEFINE_STANDARD_REPORTER(ValLoc, val, {
     printf("%s %.5f\n", val->str, val->sign * v);
   })
 
+DEFINE_STANDARD_REPORTER(HatLoc, hat, {
+    /* nyi */
+  })
+
 
 /*---------- core functions ----------*/
 
index cc2c4ec6f2096293174d42996982ac7c0792ed7f..4fb2465efe49f913b96642631f6a00b7ca0972c7 100644 (file)
@@ -52,4 +52,20 @@ void reportvals(const uint8_t msg[], const uint8_t last[],
                int len, const ValLoc vallocs[]);
 
 
+/*----- "hats", ie hatswitches -----*/
+
+typedef struct {
+  int x, y;
+} HatPosn;
+
+typedef struct {
+  const char *str; /* base; reporter will append "X" and "Y" to this */
+  int pos, rshift, max; /* mask is applied before rshift */
+  uint8_t mask;
+  const HatPosn *posns;
+} HatLoc;
+
+void reporthats(const uint8_t msg[], const uint8_t last[],
+               int len, const HatLoc hatlocs[]);
+
 #endif /*HIDRAWCONV_H*/