X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Feeprom.h;h=21ae105ae6c49a3faa3ba536b30912f769a26f83;hb=99fafc49f3b2d50abb2d7b8b4cbbd3be8e107bef;hp=5e3f78a280aa090c580ae1ba8667ebca827a4042;hpb=56a07f2d54911b40c6f14e25a342e0a8742a6938;p=bertos.git diff --git a/drv/eeprom.h b/drv/eeprom.h index 5e3f78a2..21ae105a 100644 --- a/drv/eeprom.h +++ b/drv/eeprom.h @@ -71,9 +71,10 @@ typedef uint16_t e2addr_t; * \note We can't just use offsetof() here because we could use * non-constant expressions to access array elements. * - * \note E2Layout is a structure that must be defined in user files. + * \note 'type' is the structure type holding eeprom layout + * and must be defined in user files. */ -#define e2addr(x) ((e2addr_t)&(((struct E2Layout *)0)->x)) +#define e2addr(type, field) ((e2addr_t)&(((type *)0)->field)) bool eeprom_write(e2addr_t addr, const void *buf, size_t count);