- #ifdef DEBUG_BALLER
- if (pRprt.x != 0 || pRprt.y != 0)
- xprintf("X: %d Y: %d\n", pRprt.x, pRprt.y);
- #endif
-
- if ((pBtn != trkBtnState) && ((pBtn >> 6) == 0)) pRprt.buttons |= MOUSE_BTN1;
- if ((pBtn != trkBtnState) && ((pBtn >> 6) == 1)) pRprt.buttons &= ~MOUSE_BTN1;
-
- // Save state, push update
- if (pRprt.x != 0 || pRprt.y != 0 || pRprt.h != 0 || pRprt.v != 0 || (trkBtnState != pBtn))
- pointing_device_set_report(pRprt);
-
- trkBtnState = pBtn;
- #endif
-
- // Then the keyboard
- if (mcp23018_status) { // if there was an error
- if (++mcp23018_reset_loop == 0) {
- // if (++mcp23018_reset_loop >= 1300) {
- // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans
- // this will be approx bit more frequent than once per second
- print("trying to reset mcp23018\n");
- mcp23018_status = init_mcp23018();
- if (mcp23018_status) {
- print("left side not responding\n");
- } else {
- print("left side attached\n");
- }
- }
- }
+#ifdef DEBUG_BALLER
+ if (pRprt.x != 0 || pRprt.y != 0)
+ xprintf("X: %d Y: %d\n", pRprt.x, pRprt.y);
+#endif
+
+ if ((pBtn != trkBtnState) && ((pBtn >> 6) == 0)) pRprt.buttons |= MOUSE_BTN1;
+ if ((pBtn != trkBtnState) && ((pBtn >> 6) == 1)) pRprt.buttons &= ~MOUSE_BTN1;
+
+ // Save state, push update
+ if (pRprt.x != 0 || pRprt.y != 0 || pRprt.h != 0 || pRprt.v != 0 || (trkBtnState != pBtn))
+ pointing_device_set_report(pRprt);
+
+ trkBtnState = pBtn;
+#endif
+
+ // Then the keyboard
+ if (mcp23018_status) { // if there was an error
+ if (++mcp23018_reset_loop == 0) {
+ // if (++mcp23018_reset_loop >= 1300) {
+ // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans
+ // this will be approx bit more frequent than once per second
+ print("trying to reset mcp23018\n");
+ mcp23018_status = init_mcp23018();
+ if (mcp23018_status) {
+ print("left side not responding\n");
+ } else {
+ print("left side attached\n");
+ }
+ }
+ }