25 void (*
write)(uint16_t address,
byte val);
101 updateBlock(api, address, (
const byte*)&t, ((
const byte*)&t)+
sizeof(T));
126template<
typename T >
128 byte *pFirst = (
byte*) &t;
129 const byte *pLast = pFirst +
sizeof(T);
130 (void)
loadBlock(api, address, pFirst, pLast);
uint8_t byte
Definition config_pages.h:16
const config2 const config4 const config6 statuses & current
Definition scheduler_fuel_controller.cpp:500
uint16_t updateBlockLimitWriteOps(const storage_api_t &api, uint16_t address, const byte *pFirst, const byte *pLast, uint16_t maxWrites)
Conditionally write bytes from block of memory to storage, with a limited number of write operations.
Definition storage_api.cpp:21
static void updateObject(const storage_api_t &api, const T &t, uint16_t address)
Conditionally write bytes from a POD object to storage. Values are written only if they differ from t...
Definition storage_api.h:100
uint8_t byte
Definition storage_api.h:12
void moveBlock(const storage_api_t &api, uint16_t dest, uint16_t source, uint16_t size)
Move a block of bytes.
Definition storage_api.cpp:47
bool update(const storage_api_t &api, uint16_t address, byte value)
Conditionally write a byte to storage if it differs from the one already saved.
Definition storage_api.cpp:7
static T & loadObject(const storage_api_t &api, uint16_t address, T &t)
Copy a block of data from storage into a POD object.
Definition storage_api.h:127
void updateBlock(const storage_api_t &api, uint16_t address, const byte *pFirst, const byte *pLast)
Conditionally write bytes from block of memory to storage. Values are written only if they differ fro...
Definition storage_api.cpp:15
void fillBlock(const storage_api_t &api, uint16_t address, uint16_t length, byte value)
Fills the given block with a constant.
Definition storage_api.cpp:41
uint16_t loadBlock(const storage_api_t &api, int16_t address, byte *pFirst, const byte *pLast)
Copy a block of data from storage to memory.
Definition storage_api.cpp:33
The status struct with current values for all 'live' variables.
Definition statuses.h:69
The external storage API. This must be supported by any storage system. E.g. EEPROM,...
Definition storage_api.h:20
uint16_t(* length)(void)
Function to get the size of the address space.
Definition storage_api.h:32
byte(* read)(uint16_t address)
Function to read a single byte from storage.
Definition storage_api.h:22
uint16_t(* getMaxWriteBlockSize)(const statuses ¤t)
The maximum number of write operations that will be performed in one go.
Definition storage_api.h:35
void(* write)(uint16_t address, byte val)
Function to write a single byte to storage.
Definition storage_api.h:25