From bb3e74062eafb98fce52486c1870cbf36a904107 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Mon, 25 Jul 2022 16:12:28 +0100 Subject: [PATCH] adiv5: Fixed the naming of a timeout in cortexm_prepare --- src/target/adiv5.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/target/adiv5.c b/src/target/adiv5.c index e798ce7..ea70c9b 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -428,14 +428,14 @@ static bool cortexm_prepare(ADIv5_AP_t *ap) ap->ap_cortexm_demcr = adiv5_mem_read32(ap, CORTEXM_DEMCR); const uint32_t demcr = CORTEXM_DEMCR_TRCENA | CORTEXM_DEMCR_VC_HARDERR | CORTEXM_DEMCR_VC_CORERESET; adiv5_mem_write(ap, CORTEXM_DEMCR, &demcr, sizeof(demcr)); - platform_timeout to; - platform_timeout_set(&to, cortexm_wait_timeout); + platform_timeout reset_timeout; + platform_timeout_set(&reset_timeout, cortexm_wait_timeout); platform_nrst_set_val(false); while (1) { dhcsr = adiv5_mem_read32(ap, CORTEXM_DHCSR); if (!(dhcsr & CORTEXM_DHCSR_S_RESET_ST)) break; - if (platform_timeout_is_expired(&to)) { + if (platform_timeout_is_expired(&reset_timeout)) { DEBUG_WARN("Error releasing from reset\n"); return false; }