Skip to content

Custom Boards - Read static config from flash#324

Merged
DocMoebiuz merged 38 commits intoMobiFlight:mainfrom
elral:config_from_flash_core
May 27, 2024
Merged

Custom Boards - Read static config from flash#324
DocMoebiuz merged 38 commits intoMobiFlight:mainfrom
elral:config_from_flash_core

Conversation

@elral
Copy link
Collaborator

@elral elral commented May 22, 2024

Boards can now have a fixed configuration which is stored in flash and not an EEPROM. This is useful for Custom Boards that have a predefined set of devices which cannot and should not be changed by the user.

Description of changes

  • FW reads the config from flash and from the eeprom for community devices.
  • First the config from flash is read,next from the EEPROM.
  • The configuration must be setup in the file MFCustomDevicesConfig.h with the naming CustomDeviceConfig[] which must be saved within the community folder.

The format is the same as in the EEPROM, like:

const char CustomDeviceConfig[] PROGMEM = {
        "1.2.Button Flash:"
        "8.3.4.0.Encoder Flash:"
        "11.54.5.Analog Input Flash:"
        "12.7.6.5.1.InputShifter Flash:"
        "14.12.8.9.10.11.2.Multiplexer Flash:"};

Additionally the compile flag -DHAS_CONFIG_IN_FLASH has to set in the community_platformio.ini file. Is this flag is not set, only the configuration from the EEPROM is read. This guarantees full backward compatibility.

Open points

  • For now saving a configuration to the EEPROM coming from the connector is disabled. Once it is agreed how to handle this further changes might be required.
    One approach could be that the connector sends two different commands, one to read the EEPROM content like now and another to read the flash content. The connector could mark the flash content and prevent a change in the modules dialog and not upload these config entries back to the board.
  • A second PR in the community template repo will be issued to add the uncommented compile flag and the required file with an example configuration.

Fixes #323

elral added 30 commits February 16, 2024 15:14
@elral elral requested a review from DocMoebiuz as a code owner May 22, 2024 08:07
@github-actions
Copy link

Firmware for this pull request:
Firmware.zip

@github-actions
Copy link

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

@DocMoebiuz DocMoebiuz changed the title Read config from flash Custom Boards - Read static config from flash May 27, 2024
@DocMoebiuz DocMoebiuz merged commit 3e9f6ff into MobiFlight:main May 27, 2024
@elral elral deleted the config_from_flash_core branch May 28, 2024 04:21
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.

Load configuration from Flash

2 participants