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

Read config from EEPROM only if no config is in Flash #327

Merged
merged 9 commits into from
Sep 5, 2024

Conversation

elral
Copy link
Collaborator

@elral elral commented Jul 6, 2024

Description of changes

If a configuration is already saved in the EEPROM, and the board gets updated with a new Firmware where the configuration is part of the flash, the exsiting configuration in the EEPROM gets ignored and only the one from the flash gets reported to the connector and loaded into the internal memory.

Before sending the configuration to the connector, it gets's checked if a configuration is stored in the flash. If this is the case (configLength > 0), this configuration is send to the connector. If no config in the flash is available (configLength = 0) but a config in the EEPROM saved, this config gets send to the connector.
The same applies for loading the config into the internal memory.

For now it is only checked if a configuration in the EEPROM OR Flash is available. If a configuration is saved, this one gets reported to the connector and loaded into the internal memory.

Fixes #326

@elral elral requested a review from DocMoebiuz as a code owner July 6, 2024 07:15
@elral elral changed the title Read config from eeprom only if no config is in Flash Read config from EEPROM only if no config is in Flash Jul 6, 2024
Copy link

github-actions bot commented Jul 6, 2024

Board and firmware folder for this pull request:
Mobiflight-Connector.zip

Copy link

github-actions bot commented Jul 8, 2024

Board and firmware folder for this pull request:
Mobiflight-Connector.zip

@elral
Copy link
Collaborator Author

elral commented Jul 8, 2024

For backward compatibility it is first checked, if a config in EEPROM is available. If so, this config will still be used.
Otherwise it is checked, if a config in Flash is available and if so this config get's used.

It is still possible, to upload a user config even if a config in flash is available. This overrules the flash config.
But this enables also the user, to use the flash config if an empty config get's uploaded.
The only drawback is that the connector has to be restarted if an empty config is uploaded and the flash config get's be used because the config is not read again after an upload.

Copy link

Board and firmware folder for this pull request:
Mobiflight-Connector.zip

Copy link

github-actions bot commented Sep 5, 2024

Board and firmware folder for this pull request:
Mobiflight-Connector.zip

elral and others added 2 commits September 5, 2024 08:01
Co-authored-by: Sebastian M <[email protected]>
Copy link

github-actions bot commented Sep 5, 2024

Board and firmware folder for this pull request:
Mobiflight-Connector.zip

Copy link

github-actions bot commented Sep 5, 2024

Board and firmware folder for this pull request:
Mobiflight-Connector.zip

Copy link

github-actions bot commented Sep 5, 2024

Board and firmware folder for this pull request:
Mobiflight-Connector.zip

@DocMoebiuz DocMoebiuz merged commit 1acaa19 into MobiFlight:main Sep 5, 2024
1 check passed
@elral elral deleted the fix_double_read_config branch September 5, 2024 07:35
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.

Config could get read doubled
2 participants