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

[IdleShutdown] Don't reload the settings every second #364

Merged
merged 2 commits into from
Oct 15, 2022

Conversation

lokiuox
Copy link

@lokiuox lokiuox commented Oct 15, 2022

What's new

The current implementation of the "Shutdown on Idle" features reloads the power settings file every second to check for changes in the settings. (The auto_shutdown_update() is called inside the main power service loop). This behaviour is also verifiable by checking the logs from the serial console, since they get spammed by [I][SavedStruct] Loading "/int/.power.settings"messages.

This behavior is wasteful and could be detrimental on the internal memory. The simplest solution to fix this (implemented here) is to just reboot the Flipper when the setting is changed from the menu, i.e. the same thing that happens when the battery style is changed. The Flipper will just reload the new config on the next boot and no continuous checks are needed.

Verification

Monitor the logs from the serial console to verify that the Loading calls are no more being spammed every second.

Checklist (For Reviewer)

  • PR has description of feature/bug
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@lokiuox lokiuox requested a review from RogueMaster as a code owner October 15, 2022 09:35
@RogueMaster RogueMaster merged commit dd05029 into RogueMaster:420 Oct 15, 2022
@RogueMaster
Copy link
Owner

Thank you!

@RogueMaster
Copy link
Owner

Can you check if this is still an issue with the latest changes from the original PR, and refix if necessary? @lokiuox https://github.com/RogueMaster/flipperzero-firmware-wPlugins/blob/420/0.69.1-1018-RM-0303.tgz

@lokiuox
Copy link
Author

lokiuox commented Oct 18, 2022

I tested the new release and it works correctly, no other fixes are necessary

@RogueMaster
Copy link
Owner

TY!

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