From: notaz Date: Sun, 14 Sep 2014 23:06:15 +0000 (+0300) Subject: rm unneeded test code X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=252ad0c605098ea61ba140ac3be89a6f056b5d8c;p=teensytas.git rm unneeded test code --- diff --git a/host/main.c b/host/main.c index e505959..48517a3 100644 --- a/host/main.c +++ b/host/main.c @@ -1,8 +1,6 @@ #include -//#include #include #include -//#include #include #include #include @@ -16,35 +14,6 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) -#if 0 -#include "rawhid/hid.h" - -static int g_quit; - -static void *dbg_reader(void *arg) -{ - char buf[65]; - int ret; - - buf[64] = 0; - - while (!g_quit) { - ret = rawhid_recv(0, buf, 64, 1000); - if (ret == 0) - continue; - - if (ret != 64) { - printf("\nrawhid_recv(dbg): %d\n", ret); - return NULL; - } - printf("%s", buf); - } - - // rawhid_close(0); - return NULL; -} -#endif - struct teensy_dev { int fd; struct { @@ -383,57 +352,6 @@ dev_close: dev.fd = -1; } -#if 0 - ret = rawhid_open(1, 0x16C0, 0x0486, 0xFFC9, 0x0004); - if (ret <= 0) { - fprintf(stderr, "dbg rawhid is missing\n"); - return 1; - } - - ret = rawhid_open(1, 0x16C0, 0x0486, 0xFFAB, 0x0200); - if (ret <= 0) { - fprintf(stderr, "data rawhid is missing\n"); - return 1; - } - - pthread_t thread; - ret = pthread_create(&thread, NULL, dbg_reader, NULL); - if (ret) { - fprintf(stderr, "pthread_create failed: %d\n", ret); - return 1; - } - - memset(buf, 0, sizeof(buf)); - snprintf(buf, sizeof(buf), "hi"); - - ret = rawhid_send(1, buf, 64, 220); - if (ret != 64) { - fprintf(stderr, "send failed: %d\n", ret); - } - - while (1) { - // check if any Raw HID packet has arrived - ret = rawhid_recv(1, buf, 64, 220); - if (ret < 0) { - fprintf(stderr, "\nrawhid_recv(1): %d\n", ret); - break; - } - if (ret > 0) { - printf("\nrecv %d bytes:\n", ret); - for (i=0; i