summaryrefslogtreecommitdiff
path: root/lib/ccdbg-io.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-04-17 10:10:47 -0700
committerKeith Packard <keithp@keithp.com>2009-04-17 10:10:47 -0700
commit26095fc0511ee0d5213f038986032f7c59964cf0 (patch)
tree50db1d8adbf6911bd96651de68cda3b89d21115e /lib/ccdbg-io.c
parent543bedde83cbce5145668e72965e02d892187b59 (diff)
Run-time selection between cp2103 and cc1111
Diffstat (limited to 'lib/ccdbg-io.c')
-rw-r--r--lib/ccdbg-io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ccdbg-io.c b/lib/ccdbg-io.c
index acd44f10..9c6693cd 100644
--- a/lib/ccdbg-io.c
+++ b/lib/ccdbg-io.c
@@ -21,18 +21,20 @@
#include "cc-usb.h"
#include "cc-bitbang.h"
-
struct ccdbg *
ccdbg_open(void)
{
struct ccdbg *dbg;
+ char *tty;
dbg = calloc(sizeof (struct ccdbg), 1);
if (!dbg) {
perror("calloc");
return NULL;
}
- dbg->usb = cc_usb_open();
+ tty = getenv("CCDBG_TTY");
+ if (!tty || tty[0] == '/')
+ dbg->usb = cc_usb_open(tty);
if (!dbg->usb) {
dbg->bb = cc_bitbang_open();
if (!dbg->bb) {