I am trying to get the following function to work but the compiler is giving the following error:
Does anyone have an idea what this means or how to fix?
flashStorage.cpp: In function 'void readFromMemory8_8(uint8_t&, uint8_t)':
flashStorage.cpp:829:31: error: invalid initialization of non-const reference of type 'unsigned char*&' from an rvalue of type 'uint8_t* {aka unsigned char*}'
flash->read(&data, address);
const static uint8_t startSlotAdr = 52;
uint8_t startSlot = 1;
readFromMemory8_8(startSlot, startSlotAdr); // data, address
void readFromMemory8_8(uint8_t &data, uint8_t address) {
#if PLATFORM_ID == PLATFORM_ELECTRON_PRODUCTION
EEPROM.get(address, &data);
#elif PLATFORM_ID == PLATFORM_P1
flash->read(&data, address);
#endif
}