*/
static int flash_avr_kfileFlush(struct KFile *_fd)
{
- FlashAvr *fd = FLASHAVRKFILE(_fd);
+ FlashAvr *fd = FLASHAVR_CAST(_fd);
flash_avr_flush(fd);
return 0;
}
*/
static size_t flash_avr_write(struct KFile *_fd, const void *_buf, size_t size)
{
- FlashAvr *fd = FLASHAVRKFILE(_fd);
+ FlashAvr *fd = FLASHAVR_CAST(_fd);
const uint8_t *buf =(const uint8_t *)_buf;
avr_page_t page;
*/
static int flash_avr_close(struct KFile *_fd)
{
- FlashAvr *fd = FLASHAVRKFILE(_fd);
+ FlashAvr *fd = FLASHAVR_CAST(_fd);
flash_avr_flush(fd);
LOG_INFO("Flash file closed\n");
return 0;
*/
static struct KFile *flash_avr_reopen(struct KFile *fd)
{
- FlashAvr *_fd = FLASHAVRKFILE(fd);
+ FlashAvr *_fd = FLASHAVR_CAST(fd);
flash_avr_close(fd);
flash_avr_open(_fd);
return fd;
*/
static size_t flash_avr_read(struct KFile *_fd, void *buf, size_t size)
{
- FlashAvr *fd = FLASHAVRKFILE(_fd);
+ FlashAvr *fd = FLASHAVR_CAST(_fd);
ASSERT(fd->fd.seek_pos + (kfile_off_t)size <= (kfile_off_t)fd->fd.size);
size = MIN((uint32_t)size, fd->fd.size - fd->fd.seek_pos);
/**
* Convert + ASSERT from generic KFile to FlashAvr.
*/
-INLINE FlashAvr * FLASHAVRKFILE(KFile *fd)
+INLINE FlashAvr * FLASHAVR_CAST(KFile *fd)
{
ASSERT(fd->_type == KFT_FLASHAVR);
return (FlashAvr *)fd;