1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 01:35:35 +03:00

Added missing function for saveConfig()

This can be used instead of writeEEPROM() if the FC is not rebooted after writing. This will also consolidated multiple saves.
This commit is contained in:
Darren Lines 2022-10-02 11:54:07 +01:00
parent ce6265d46c
commit 0d483a04ae
2 changed files with 17 additions and 0 deletions

View file

@ -363,12 +363,28 @@ void ensureEEPROMContainsValidData(void)
resetEEPROM();
}
/*
* Used to save the EEPROM and notify the user with beeps and OSD notifications.
* This consolidates all save calls in the loop in to a single save operation. This save is actioned at the start of the next loop.
*/
void saveConfigAndNotify(void)
{
osdStartedSaveProcess();
saveState = SAVESTATE_SAVEANDNOTIFY;
}
/*
* Used to save the EEPROM without notifications. Can be used instead of writeEEPROM() if no reboot is called after the write.
* This consolidates all save calls in the loop in to a single save operation. This save is actioned at the start of the next loop.
* If any save with notifications are requested, notifications are shown.
*/
void saveConfig(void)
{
if (saveState != SAVESTATE_SAVEANDNOTIFY) {
saveState = SAVESTATE_SAVEONLY;
}
}
void processDelayedSave(timeUs_t currentTimeUs)
{
UNUSED(currentTimeUs);