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

Power: Suppress Shutdown on Idle While Charging / Plugged In #244

Merged
merged 8 commits into from
Oct 8, 2024

Conversation

luu176
Copy link
Contributor

@luu176 luu176 commented Oct 5, 2024

This implements safeguard to prevent the flipper zero from shutting down while it's in a charging state. By doing so, we ensure that the battery charges fully without interruption.

What's new

  • Modified the power_auto_shutdown_timer_callback function to check the power state.
  • If the device is charging, the shutdown process is suppressed, and the original shutdown timer is restarted based on the configured shutdown_idle_delay_ms
  • The shutdown_idle_delay_ms value is now dynamically retrieved from the PowerSettings to ensure the timer is set accurately according to user-defined settings.

Copy link
Member

@Willy-JL Willy-JL left a comment

Choose a reason for hiding this comment

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

also please run ./fbt format

applications/services/power/power_service/power.c Outdated Show resolved Hide resolved
applications/services/power/power_service/power.c Outdated Show resolved Hide resolved
@Willy-JL
Copy link
Member

Willy-JL commented Oct 7, 2024

The shutdown_idle_delay_ms value is now dynamically retrieved from the PowerSettings to ensure the timer is set accurately according to user-defined settings.

no point, when user changes this value, it is updated in service accordingly. this is just loading from file when theres no need to :D

@Willy-JL Willy-JL marked this pull request as draft October 7, 2024 03:32
@Willy-JL Willy-JL added the bugfix Something isn't working label Oct 7, 2024
luu176 and others added 4 commits October 7, 2024 07:21
Co-authored-by: WillyJL <49810075+Willy-JL@users.noreply.github.com>
Co-authored-by: WillyJL <49810075+Willy-JL@users.noreply.github.com>
@Willy-JL Willy-JL marked this pull request as ready for review October 8, 2024 03:36
@Willy-JL Willy-JL changed the title Suppress Shutdown on Idle While Charging Power: Suppress Shutdown on Idle While Charging / Plugged In Oct 8, 2024
@Willy-JL Willy-JL merged commit eef9c42 into Next-Flip:dev Oct 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants