+/* Serial spaceball and space-mouse example driver code for UNIX systems.
+ * Tested with Spaceball 4000FLX and Magellan SpaceMouse on GNU/Linux, FreeBSD,
+ * SGI/IRIX, and SunOS (Solaris/Illumos).
+ *
+ * Author: John Tsiombikas <nuclear@member.fsf.org>
+ * No copyright, public domain.
+ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
return -1;
}
for(i=0; i<6; i++) {
-#ifdef SBALL_BIG_ENDIAN
- sb->mot[i] = ((((int)data[3] & 0xf) << 12) | (((int)data[2] & 0xf) << 8) |
- (((int)data[1] & 0xf) << 4) | (data[0] & 0xf)) - 0x8000;
-#else
sb->mot[i] = ((((int)data[0] & 0xf) << 12) | (((int)data[1] & 0xf) << 8) |
(((int)data[2] & 0xf) << 4) | (data[3] & 0xf)) - 0x8000;
-#endif
data += 4;
}
print_state(sb);