summaryrefslogtreecommitdiff
path: root/tools/atmega324u_usbhid/reset.c
diff options
context:
space:
mode:
authorBernhard Tittelbach <xro@realraum.at>2012-05-19 20:48:29 +0000
committerBernhard Tittelbach <xro@realraum.at>2012-05-19 20:48:29 +0000
commit8ddbd3faab208bf46f907f86dba319f3153613de (patch)
treeee2a7425d61f31f9e798f6877a7eaac54097a213 /tools/atmega324u_usbhid/reset.c
parentclean reset (diff)
moved hid70dongle usbhid pc interface
git-svn-id: https://svn.spreadspace.org/mur.sat@443 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'tools/atmega324u_usbhid/reset.c')
-rw-r--r--tools/atmega324u_usbhid/reset.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/atmega324u_usbhid/reset.c b/tools/atmega324u_usbhid/reset.c
new file mode 100644
index 0000000..7955b1b
--- /dev/null
+++ b/tools/atmega324u_usbhid/reset.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <string.h>
+
+#include "hid.h"
+
+
+void sendstr(char * tosend)
+{
+ rawhid_send(0, tosend, strlen(tosend),1000);
+}
+
+int main (int argc, char *argv[])
+{
+ // C-based example is 16C0:0480:FFAB:0200
+ int r = rawhid_open(1, 0x16C0, 0x0481, 0xFFAB, 0x0200);
+ if (r <= 0) {
+ printf("no rawhid device found\n");
+ return -1;
+ }
+ sendstr("r"); // clear the buffer
+ return 0;
+}