Skip to content

Don't delete config if UniqueID was used for AVR's#312

Merged
DocMoebiuz merged 5 commits intoMobiFlight:mainfrom
elral:serial_number_handling
May 5, 2024
Merged

Don't delete config if UniqueID was used for AVR's#312
DocMoebiuz merged 5 commits intoMobiFlight:mainfrom
elral:serial_number_handling

Conversation

@elral
Copy link
Copy Markdown
Collaborator

@elral elral commented Jan 14, 2024

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

@elral elral requested a review from DocMoebiuz as a code owner January 14, 2024 18:31
@github-actions
Copy link
Copy Markdown

Firmware for this pull request:
Firmware.zip

@github-actions
Copy link
Copy Markdown

Firmware for this pull request:
Firmware.zip

Copy link
Copy Markdown
Collaborator

@DocMoebiuz DocMoebiuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@DocMoebiuz DocMoebiuz merged commit aae98e1 into MobiFlight:main May 5, 2024
@DocMoebiuz DocMoebiuz added the bug Something isn't working label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config gets deleted if UniqueID was used for AVR's

2 participants