aboutsummaryrefslogtreecommitdiff
path: root/src/adiv5_swdp.c
diff options
context:
space:
mode:
authorGareth McMullin2012-07-05 19:23:28 +1200
committerGareth McMullin2012-07-05 19:23:28 +1200
commit00c4dbfb11e389176bdb2d45a262eb47229cd80b (patch)
treefcd39820419eaece7a4a8a5ed81fefc1702bac66 /src/adiv5_swdp.c
parentaf1ef670ba50a29546fa165f159f66fe5d2d0868 (diff)
ADIv5 AP and DP are now allocated on the heap and reference counted.
They are unref'd and free'd automatically when the target list is destroyed.
Diffstat (limited to 'src/adiv5_swdp.c')
-rw-r--r--src/adiv5_swdp.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/adiv5_swdp.c b/src/adiv5_swdp.c
index f1e4bf4..06d5446 100644
--- a/src/adiv5_swdp.c
+++ b/src/adiv5_swdp.c
@@ -47,14 +47,10 @@ static uint32_t adiv5_swdp_low_access(ADIv5_DP_t *dp, uint8_t APnDP, uint8_t RnW
int adiv5_swdp_scan(void)
{
- ADIv5_DP_t *dp;
uint8_t ack;
target_list_free();
-#warning "These should be elsewhere!"
- adiv5_free_all();
-
- dp = (void*)calloc(1, sizeof(ADIv5_DP_t));
+ ADIv5_DP_t *dp = (void*)calloc(1, sizeof(*dp));
swdptap_init();
/* Read the SW-DP IDCODE register to syncronise */