*/
static size_t eeprom_writeRaw(struct KFile *_fd, const void *buf, size_t size)
{
- Eeprom *fd = EEPROM(_fd);
+ Eeprom *fd = EEPROM_CAST(_fd);
e2dev_addr_t dev_addr;
uint8_t addr_buf[2];
uint8_t addr_len;
*/
static size_t eeprom_writeVerify(struct KFile *_fd, const void *_buf, size_t size)
{
- Eeprom *fd = EEPROM(_fd);
+ Eeprom *fd = EEPROM_CAST(_fd);
int retries = 5;
size_t wr_len;
*/
static size_t eeprom_read(struct KFile *_fd, void *_buf, size_t size)
{
- Eeprom *fd = EEPROM(_fd);
+ Eeprom *fd = EEPROM_CAST(_fd);
uint8_t addr_buf[2];
uint8_t addr_len;
size_t rd_len = 0;
/**
* Convert + ASSERT from generic KFile to Eeprom.
*/
-INLINE Eeprom * EEPROM(KFile *fd)
+INLINE Eeprom * EEPROM_CAST(KFile *fd)
{
ASSERT(fd->_type == KFT_EEPROM);
return (Eeprom *)fd;
*/
static size_t ft245rl_read(struct KFile *_fd, void *_buf, size_t size)
{
- Ft245rl *fd = FT245RL(_fd);
+ Ft245rl *fd = FT245RL_CAST(_fd);
(void)fd; //unused
uint8_t *buf = (uint8_t *)_buf;
size_t total_read = 0;
*/
static size_t ft245rl_write(struct KFile *_fd, const void *_buf, size_t size)
{
- Ft245rl *fd = FT245RL(_fd);
+ Ft245rl *fd = FT245RL_CAST(_fd);
(void)fd; //unused
const uint8_t *buf = (const uint8_t *)_buf;
size_t total_write = 0;
/**
* Convert + ASSERT from generic KFile to KFileFt245rl.
*/
-INLINE Ft245rl * FT245RL(KFile *fd)
+INLINE Ft245rl * FT245RL_CAST(KFile *fd)
{
ASSERT(fd->_type == KFT_FT245RL);
return (Ft245rl *)fd;