Skip to content

Commit

Permalink
Always delay before system_reset to ensure it doesn't brick the MCU
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Dec 12, 2024
1 parent 5243b11 commit 616449c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion software/firmware/src/peripherals/src/ranging.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ void ranging_radio_reset(void)
if (dwt_probe((struct dwt_probe_s*)&driver_interface) != DWT_SUCCESS)
{
print("ERROR: Could not successfully probe DW3000 peripheral...resetting entire device\n");
am_util_delay_ms(1000);
system_reset(false);
}
configASSERT0(dwt_initialise(DWT_DW_IDLE));
Expand Down
5 changes: 4 additions & 1 deletion software/firmware/src/peripherals/src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ void system_reset(bool immediate)
}
else
#endif
am_hal_reset_control(AM_HAL_RESET_CONTROL_SWPOR, NULL);
{
am_util_delay_ms(1000);
am_hal_reset_control(AM_HAL_RESET_CONTROL_SWPOR, NULL);
}
}

void system_enable_interrupts(bool enabled)
Expand Down

0 comments on commit 616449c

Please sign in to comment.