/* 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;
}
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);