chiark / gitweb /
Debugging: Print each touch's state bitmask in mtstate_output
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Apr 2016 19:54:49 +0000 (20:54 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 Apr 2016 19:42:32 +0000 (20:42 +0100)
The user is expected to decode the hex (with reference to the bit
numbers defined in mtstate.h).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/mtstate.c

index 348d214..bd9a7e3 100644 (file)
@@ -286,25 +286,25 @@ static void mtstate_output(const struct MTState* ms,
        foreach_bit(i, ms->touch_used) {
                if (GETBIT(ms->touch[i].state, MT_RELEASED)) {
                        timersub(&hs->evtime, &ms->touch[i].down, &tv);
-                       xf86Msg(X_INFO, "  released p(%d, %d) d(%d, %d) dir(%f) down(%llu) time(%lld)\n",
+                       xf86Msg(X_INFO, "  released p(%d, %d) d(%d, %d) dir(%f) down(%llu) state("PRBITMASK") time(%lld)\n",
                                                ms->touch[i].x, ms->touch[i].y, ms->touch[i].dx, ms->touch[i].dy,
-                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), timertoms(&tv));
+                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), ms->touch[i].state, timertoms(&tv));
                }
                else if (GETBIT(ms->touch[i].state, MT_NEW)) {
-                       xf86Msg(X_INFO, "  new      p(%d, %d) d(%d, %d) dir(%f) down(%llu)\n",
+                       xf86Msg(X_INFO, "  new      p(%d, %d) d(%d, %d) dir(%f) down(%llu) state("PRBITMASK")\n",
                                                ms->touch[i].x, ms->touch[i].y, ms->touch[i].dx, ms->touch[i].dy,
-                                               ms->touch[i].direction, timertoms(&ms->touch[i].down));
+                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), ms->touch[i].state);
                }
                else if (GETBIT(ms->touch[i].state, MT_INVALID)) {
                        timersub(&hs->evtime, &ms->touch[i].down, &tv);
-                       xf86Msg(X_INFO, "  invalid  p(%d, %d) d(%d, %d) dir(%f) down(%llu) time(%lld)\n",
+                       xf86Msg(X_INFO, "  invalid  p(%d, %d) d(%d, %d) dir(%f) down(%llu) state("PRBITMASK") time(%lld)\n",
                                                ms->touch[i].x, ms->touch[i].y, ms->touch[i].dx, ms->touch[i].dy,
-                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), timertoms(&tv));
+                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), ms->touch[i].state, timertoms(&tv));
                }
                else {
-                       xf86Msg(X_INFO, "  touching p(%d, %d) d(%d, %d) dir(%f) down(%llu)\n",
+                       xf86Msg(X_INFO, "  touching p(%d, %d) d(%d, %d) dir(%f) down(%llu) state("PRBITMASK")\n",
                                                ms->touch[i].x, ms->touch[i].y, ms->touch[i].dx, ms->touch[i].dy,
-                                               ms->touch[i].direction, timertoms(&ms->touch[i].down));
+                                               ms->touch[i].direction, timertoms(&ms->touch[i].down), ms->touch[i].state);
                }
        }
 }