detection works
[sball] / src / main.c
index 7fe32c5..04b0ace 100644 (file)
@@ -2,15 +2,15 @@
 #include <stdlib.h>
 #include "sball.h"
 
-static int fd;
+static struct sball *sb;
 
 int main(int argc, char **argv)
 {
-       if(!(fd = sball_open(argv[1] ? argv[1] : "/dev/ttyS0"))) {
+       if(!(sb = sball_open(argv[1] ? argv[1] : "/dev/ttyS0"))) {
                fprintf(stderr, "Failed to open spaceball at %s\n", argv[1] ? argv[1] : "/dev/ttyS0");
                return 1;
        }
 
-       sball_close(fd);
+       sball_close(sb);
        return 0;
 }