projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Make serial test simpler
[fw/altos]
/
lib
/
cccp.c
diff --git
a/lib/cccp.c
b/lib/cccp.c
index 99a0d81f1a11a895d470d558d7fdfe6caa8ac585..34e866e89c4cda97c248702a55ad63bb1061b3ac 100644
(file)
--- a/
lib/cccp.c
+++ b/
lib/cccp.c
@@
-98,3
+98,15
@@
cccp_fini(struct ccdbg *dbg)
cccp_write(dbg, 0xf, 0xf);
dbg->clock = 1;
}
+
+cccp_open()
+{
+ dbg->fd = open("/dev/ttyUSB0", 2);
+ if (dbg->fd < 0) {
+ perror(file);
+ free(dbg);
+ return NULL;
+ }
+ cccp_init(dbg);
+ cccp_write(dbg, CC_CLOCK, CC_CLOCK);
+}