diff options
author | Keith Packard <keithp@keithp.com> | 2009-04-06 11:31:49 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-04-06 11:32:21 -0700 |
commit | 2d9b8a83a2d9f495199033e43f519d26f27938fe (patch) | |
tree | 495a2cbf1573ac0b42d6331e9627e28448c65ef7 /lib/ccdbg-manual.c | |
parent | 24edd56155ed0fa02fdd8f66fdc7aa5a1021bf7d (diff) |
Add support for a serial-connected custom debug dongle
This uses the cc1111 board as a custom debug dongle with faster
methods for communicating with the debug target.
Diffstat (limited to 'lib/ccdbg-manual.c')
-rw-r--r-- | lib/ccdbg-manual.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/ccdbg-manual.c b/lib/ccdbg-manual.c index df79d88d..0e811b76 100644 --- a/lib/ccdbg-manual.c +++ b/lib/ccdbg-manual.c @@ -17,6 +17,7 @@ */ #include "ccdbg.h" +#include "cc-bitbang.h" /* * Manual bit-banging to debug the low level protocol @@ -47,6 +48,10 @@ ccdbg_manual(struct ccdbg *dbg, FILE *input) char line[80]; uint8_t set, mask; + if (dbg->bb == NULL) { + fprintf(stderr, "Must use bitbang API for manual mode\n"); + return; + } while (fgets(line, sizeof line, input)) { if (line[0] == '#' || line[0] == '\n') { printf ("%s", line); @@ -59,14 +64,14 @@ ccdbg_manual(struct ccdbg *dbg, FILE *input) get_bit(line, 4, 'R', CC_RESET_N, &set, &mask); if (mask != (CC_CLOCK|CC_DATA|CC_RESET_N)) { uint8_t read; - ccdbg_read(dbg, &read); - ccdbg_sync_io(dbg); - ccdbg_print("\t%c %c %c", CC_CLOCK|CC_DATA|CC_RESET_N, read); + cc_bitbang_read(dbg->bb, &read); + cc_bitbang_sync(dbg->bb); + cc_bitbang_print("\t%c %c %c", CC_CLOCK|CC_DATA|CC_RESET_N, read); if ((set & CC_CLOCK) == 0) printf ("\t%d", (read&CC_DATA) ? 1 : 0); printf ("\n"); } - ccdbg_send(dbg, mask, set); - ccdbg_sync_io(dbg); + cc_bitbang_send(dbg->bb, mask, set); + cc_bitbang_sync(dbg->bb); } } |