From 1bef51e14503de47c3be22891f7b14f42f67293f Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Tue, 3 Dec 2019 23:00:08 +0100 Subject: [PATCH] adiv5: Abort scanning APs after 8 void APs. --- src/target/adiv5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/target/adiv5.c b/src/target/adiv5.c index 334a665..9b74c87 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -489,11 +489,13 @@ void adiv5_dp_init(ADIv5_DP_t *dp) } /* Probe for APs on this DP */ uint32_t last_base = 0; - for(int i = 0; i < 256; i++) { + int void_aps = 0; + for(int i = 0; (i < 256) && (void_aps < 8); i++) { ADIv5_AP_t *ap = NULL; if (adiv5_ap_setup(i)) ap = adiv5_new_ap(dp, i); if (ap == NULL) { + void_aps++; adiv5_ap_cleanup(i); if (i == 0) return;