The first four functions listed determine the type of object being recorded. Thus, an internal function might look like this:
void eeprom_update_float (float *addr, float value)
{
*addr = value;
}
This offers the benefits of type safety (for example, cannot write floatto uint16_t), ensuring that the destination pointer matches the source variable.
void eeprom_update_block() . , - memcpy :
void eeprom_update_block (const void *src, void *dst, size_t n)
{
memcpy(dst, src, n);
}
- , . , :
eeprom_update_block(&myStruct, dst, sizeof(myStruct));