X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Favr%2Fdrv%2Fflash_avr.c;h=03740dd7c5c121a506fac670e9048103124a698d;hb=92d5e5f668bb596036e7c4fe674b29448f7ac65d;hp=daaf4d9b6f72a071eeec902a2283f6609a2d5699;hpb=515886be3106584a6d695d4b5453730121b91f74;p=bertos.git diff --git a/bertos/cpu/avr/drv/flash_avr.c b/bertos/cpu/avr/drv/flash_avr.c index daaf4d9b..03740dd7 100644 --- a/bertos/cpu/avr/drv/flash_avr.c +++ b/bertos/cpu/avr/drv/flash_avr.c @@ -178,7 +178,7 @@ static size_t flash_avr_write(struct KFile *_fd, const void *_buf, size_t size) 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); + size = MIN((kfile_off_t)size, fd->fd.size - fd->fd.seek_pos); LOG_INFO("Writing at pos[%u]\n", fd->fd.seek_pos); while (size) @@ -249,7 +249,7 @@ static size_t flash_avr_read(struct KFile *_fd, void *buf, size_t size) { 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); + size = MIN((kfile_off_t)size, fd->fd.size - fd->fd.seek_pos); LOG_INFO("Reading at pos[%u]\n", fd->fd.seek_pos); // Flush current buffered page (if modified).