-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Consolidate post flight and non-essential save calls in to a single save action #8439
Consolidate post flight and non-essential save calls in to a single save action #8439
Conversation
This PR reduces the number of non-essential saves processed by the flight controller. Currently, all calls to `saveConfigAndNotify()` are processed immediately. This means that multiple saves can be processed in the same loop. This PR changes that function to set a flag, to process the save in the next loop. Meaning multiple save calls are now consolidated in to a single call. For example, continuous servo trim and stats would both call save. Now, there would be a single save for both features. Saving stats and continuous servo trim have been moved over to `saveConfigAndNotify()`. Also, messages has been added to the OSD. A `** SAVING SETTINGS ** messages appears when the save is requested. Then a `** SETTINGS SAVED **` message takes over for 5 seconds; once the save command has completed. These are shown with both standard `SYSTEM MESSAGES` and on the stats screen.
This can be used instead of writeEEPROM() if the FC is not rebooted after writing. This will also consolidated multiple saves.
…://github.com/iNavFlight/inav into MrD_Minimise-save-calls-and-show-notification
- removed `SAVE` task - moved `processDelayedSave()` call in to `SYSTEM`
Would moving Line 873 in fe37791
e.g.:
This would only call |
That would actually make sense. It would also force the system to be disarmed before the saving command can be executed, It just seems strange putting it in the PID loop. |
@breadoven moved the call in to the !ARMED position recommended. Tested and working on the bench. Tested by adjusting fixed wing level trim. New, saved value present after power cycle. |
I agree the PID loop doesn't exactly seem the right place but then again there seem to be various things in there already that are only loosely PID related. Maybe it needs renaming to something else other than PID, Action or Control loop ?. |
@stronnag @breadoven are you happy with the changes? |
I also corrected some buggy behavior that was happening surrounding the stick commands to change pages for multi-page stats.
Fixes #3838
This PR reduces the number of non-essential saves processed by the flight controller. Currently, all calls to
saveConfigAndNotify()
are processed immediately. This means that multiple saves can be processed in the same loop. This PR changes that function to set a flag, to process the save in the next loop. Meaning multiple save calls are now consolidated in to a single save action. For example, continuous servo trim and stats would both call save. Now, there would be a single save for both features. Saving stats and continuous servo trim have been moved over tosaveConfigAndNotify()
. Another functionsaveConfig();
has been added for saves where notification is not needed. Going forward, anything that saves on disarm should usesaveConfigAndNotify()
. Other saves, currently usingwriteEEPROM()
, that do not reboot after saving; can instead usesaveConfig()
to schedule and consolidate actual saves.Also, messages has been added to the OSD. A
** SAVING SETTINGS **
messages appears when the save is requested. Then a** SETTINGS SAVED **
message takes over for 5 seconds; once the save command has completed. These are shown with both standardSYSTEM MESSAGES
and on the stats screens.