adiv5: Fixed the naming of a timeout in cortexm_prepare

This commit is contained in:
dragonmux 2022-07-25 16:12:28 +01:00 committed by Rachel Mant
parent 013b2dee60
commit bb3e74062e
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}