Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor boot delay handling into _get_boot_delay() method #528

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

gemenerik
Copy link
Member

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.

@gemenerik gemenerik requested a review from ToveRumar March 19, 2025 13:18
@gemenerik gemenerik self-assigned this Mar 19, 2025
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.
@gemenerik gemenerik force-pushed the rik/flash-detect-boot-delay branch from 1a8638a to 236a344 Compare March 19, 2025 13:24
Copy link
Contributor

@ToveRumar ToveRumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@gemenerik gemenerik merged commit 0160110 into master Mar 19, 2025
1 check passed
@gemenerik gemenerik deleted the rik/flash-detect-boot-delay branch March 19, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants