summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-29 18:52:05 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-29 18:52:05 +0000
commit269aa8e99af515b95a27f46286988cfd69d967a5 (patch)
tree39708180dde1cadd08af65af9fa4b3dddfbc81d4 /src
parent69749dbcb3d52b150af3b0c50c41f459765cc76b (diff)
downloadopenocd+libswd-269aa8e99af515b95a27f46286988cfd69d967a5.tar.gz
openocd+libswd-269aa8e99af515b95a27f46286988cfd69d967a5.tar.bz2
openocd+libswd-269aa8e99af515b95a27f46286988cfd69d967a5.tar.xz
openocd+libswd-269aa8e99af515b95a27f46286988cfd69d967a5.zip
- fix bug with emulated cortex_m3 dcc channel
git-svn-id: svn://svn.berlios.de/openocd/trunk@402 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/target/cortex_m3.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c
index 8e8665bc..3a567aba 100644
--- a/src/target/cortex_m3.c
+++ b/src/target/cortex_m3.c
@@ -1372,8 +1372,12 @@ int cortex_m3_dcc_read(swjdp_common_t *swjdp, u8 *value, u8 *ctrl)
/* write ack back to software dcc register
* signify we have read data */
- dcrdr = 0;
- ahbap_write_buf_u16( swjdp, (u8*)&dcrdr, 1, DCB_DCRDR);
+ if (dcrdr & (1 << 0))
+ {
+ dcrdr = 0;
+ ahbap_write_buf_u16( swjdp, (u8*)&dcrdr, 1, DCB_DCRDR);
+ }
+
return ERROR_OK;
}
@@ -1413,10 +1417,11 @@ int cortex_m3_handle_target_request(void *priv)
cortex_m3_dcc_read(swjdp, &data, &ctrl);
/* check if we have data */
- if (ctrl & (1<<0))
+ if (ctrl & (1 << 0))
{
u32 request;
+ /* we assume target is quick enough */
request = data;
cortex_m3_dcc_read(swjdp, &data, &ctrl);
request |= (data << 8);