Refactor boot delay handling into _get_boot_delay()
method
#528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaced the previous ad-hoc boot delay checks with a dedicated
_get_boot_delay()
method. This function reads deck memory before flashing and determines if an AI deck is attached, returning the appropriate boot delay. This improves clarity, reduces the risk of missing a required delay, and ensures consistency in handling delayed boots.The method is now called within
flash_full
, ensuring the correct boot delay is used in all standard flashing operations. Responsibility for handling the delay remains with the caller in other cases, making the function more flexible while maintaining internal consistency.This also fixes a known issue where flashing from a firmware zip does not include the AI-deck chips in the
deck_targets
, even if binaries for them are present. With this change, the boot delay is always applied when an AI deck is attached, regardless of whether it is part of the flashing process, ensuring the device always has enough time to reboot properly.