projects
/
fw
/
altos
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3cc8d11
)
Sometimes the link breaks and the GET_PC command returns garbage
author
Keith Packard
<keithp@keithp.com>
Mon, 2 Mar 2009 02:43:03 +0000
(18:43 -0800)
committer
Keith Packard
<keithp@keithp.com>
Mon, 2 Mar 2009 02:43:03 +0000
(18:43 -0800)
lib/ccdbg-command.c
patch
|
blob
|
history
diff --git
a/lib/ccdbg-command.c
b/lib/ccdbg-command.c
index 2b29fdee72c8a49573ef9910632a948e73a4b9ae..d99e8ff3155cd5ea00add5e37d88953c9023d972 100644
(file)
--- a/
lib/ccdbg-command.c
+++ b/
lib/ccdbg-command.c
@@
-70,7
+70,14
@@
ccdbg_rd_config(struct ccdbg *dbg)
uint16_t
ccdbg_get_pc(struct ccdbg *dbg)
{
- return ccdbg_cmd_write_read16(dbg, CC_GET_PC, NULL, 0);
+ uint16_t pc1, pc2;
+
+ pc1 = ccdbg_cmd_write_read16(dbg, CC_GET_PC, NULL, 0);
+ pc2 = ccdbg_cmd_write_read16(dbg, CC_GET_PC, NULL, 0);
+ if (pc1 != pc2)
+ fprintf (stderr, "Invalid pc %04x != %04x\n",
+ pc1, pc2);
+ return pc2;
}
uint8_t