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

Add auto restart on power loss if PLR is enabled. #26658

Open
wants to merge 4 commits into
base: bugfix-2.1.x
Choose a base branch
from

Conversation

vovodroid
Copy link
Contributor

Implements [FR] Power Loss Recovery with UPS: auto resume printing if power was immediately restored. #26604

This PR adds option for auto reboot if Auto power loss print resume with temperature limitation #26649 is enabled.

Usage scenario is if printer has UPS and power restored within seconds, while UPS still has a power, printer is stuck at "Restart" message, though it's desirable to continue immediately while the bed/chamber are still hot.

@thinkyhead
Copy link
Member

My time is precious. Please make the effort to properly format the code as it will save me several minutes of extra work.

@vovodroid
Copy link
Contributor Author

Sorry, reformatted. I hope it's OK now.


for (uint16_t i = 0; i < PLR_REBOOT_TIMEOUT; i++) {
hal.watchdog_refresh();
delay(1000);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried delay and safe_delay methods, but they seem freezing forever and system was restarted by watchdog after four seconds. The only working method I found was delayMicroseconds

@vovodroid
Copy link
Contributor Author

I would combine this PR with PLR: heat bed while waiting for user confirmation. #26691 Thus if auto resume is disabled at least bed heating will start as soon as possible.

@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 2 times, most recently from 9c65146 to 4f65466 Compare January 26, 2024 00:13
@vovodroid vovodroid changed the title Add auto restart If PLR auto resume enabled. Add auto restart on power loss if PLR is enabled. Jan 26, 2024
@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 3 times, most recently from 37d77d6 to aa44542 Compare September 28, 2024 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants