Don't delete config if UniqueID was used for AVR's#312
Merged
DocMoebiuz merged 5 commits intoMobiFlight:mainfrom May 5, 2024
Merged
Don't delete config if UniqueID was used for AVR's#312DocMoebiuz merged 5 commits intoMobiFlight:mainfrom
DocMoebiuz merged 5 commits intoMobiFlight:mainfrom
Conversation
|
Firmware for this pull request: |
|
Firmware for this pull request: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
On a short period of time UniqueID was used for AVR's. This was rolled back and it was intended to generate a new serial number. Unfortenutely this wasn't introduced, instead a new board was detected and the config was deleted by writing 0x00 to the first location of the config in the EEPROM.
With this a serial number gets generated if a UniqueID is used for AVR's. Additionally it's checked if it's a first time starting up this board by checking the first eeprom loation for the config. It must be 0xFF (blank EEPROM), otherwise it is assumed that reading the serial number failed. In this case no new serial number is generated.
Deleting the config will not be done anymore.
On a first start up of the board the EEPROM contains always 0xFF. If the config get's read from the connector, all 0xFF up to the MEMLEN_CONFIG gets transferred. This is changed, it is checked if the first Byte of the config is 0xFF, in this case an empty config is assumed and no config gets transferred to the connector.
Fixes #313