projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for a serial-connected custom debug dongle
[fw/altos]
/
lib
/
ccdbg-manual.c
diff --git
a/lib/ccdbg-manual.c
b/lib/ccdbg-manual.c
index df79d88d96d8c3e5ec67ab54715ae9264366256c..0e811b76ac346be350ebd6cec9cccd97e5fcc99c 100644
(file)
--- a/
lib/ccdbg-manual.c
+++ b/
lib/ccdbg-manual.c
@@
-17,6
+17,7
@@
*/
#include "ccdbg.h"
*/
#include "ccdbg.h"
+#include "cc-bitbang.h"
/*
* Manual bit-banging to debug the low level protocol
/*
* 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;
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);
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;
get_bit(line, 4, 'R', CC_RESET_N, &set, &mask);
if (mask != (CC_CLOCK|CC_DATA|CC_RESET_N)) {
uint8_t read;
- cc
dbg_read(dbg
, &read);
- cc
dbg_sync_io(dbg
);
- cc
db
g_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
_bitban
g_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");
}
if ((set & CC_CLOCK) == 0)
printf ("\t%d", (read&CC_DATA) ? 1 : 0);
printf ("\n");
}
- cc
dbg_send(dbg
, mask, set);
- cc
dbg_sync_io(dbg
);
+ cc
_bitbang_send(dbg->bb
, mask, set);
+ cc
_bitbang_sync(dbg->bb
);
}
}
}
}