cancel
Showing results for 
Search instead for 
Did you mean: 

What's the best location for request read from EEPROM for init

nico23
Senior III

I would like to read some data from the EEPROM on initialization to use in the TouchGFX application.

I currently have an API that can request read/write operations from TouchGFX to the backend.

At the moment, I've implemented it in the Model.hpp

    void bind(ModelListener* listener)
    {
        modelListener = listener;

        if (!storageInitialized) {
            initializeFromStorage();
            storageInitialized = true;
        }
    }

with

void Model::initializeFromStorage()
{
    #ifndef SIMULATOR
    StorageResponse_t wr = Storage_Request(STORAGE_CMD_READ,
                                            EEPROM_ADDR_STRUCT_2,
                                            &struct2,
                                            sizeof(struct2));
    
    wr = Storage_Request(STORAGE_CMD_READ,
                            EEPROM_ADDR_STRUCT_1,
                            &struct1,
                            sizeof(struct1));
    #endif
}

but I'm not sure if it's the correct location.

I just want to send the read EEPROM command on the first load of TouchGFX and never again

0 REPLIES 0