diff --git a/src/target/adiv5.c b/src/target/adiv5.c index cf2983d..d6eafe9 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -691,8 +691,7 @@ void adiv5_dp_init(ADIv5_DP_t *dp) } } - uint32_t dp_idcode = adiv5_dp_read(dp, ADIV5_DP_IDCODE); - if ((dp_idcode & ADIV5_DP_VERSION_MASK) == ADIV5_DPv2) { + if ((dp->idcode & ADIV5_DP_VERSION_MASK) == ADIV5_DPv2) { /* Read TargetID. Can be done with device in WFI, sleep or reset!*/ adiv5_dp_write(dp, ADIV5_DP_SELECT, ADIV5_DP_BANK2); dp->targetid = adiv5_dp_read(dp, ADIV5_DP_CTRLSTAT);