X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Favr%2Fdrv%2Fflash_avr.c;h=03740dd7c5c121a506fac670e9048103124a698d;hb=32d1445272120a254d77ce8d1af1f527da7a2c17;hp=413cac80b5f5063da9998ede9445f55a70ee4096;hpb=c13bce9eb60b232b77fee6096202a4090b47e5fc;p=bertos.git diff --git a/bertos/cpu/avr/drv/flash_avr.c b/bertos/cpu/avr/drv/flash_avr.c index 413cac80..03740dd7 100644 --- a/bertos/cpu/avr/drv/flash_avr.c +++ b/bertos/cpu/avr/drv/flash_avr.c @@ -50,9 +50,9 @@ #include #include - // Define logging setting (for cfg/log.h module). -#define LOG_LEVEL CONFIG_FLASH_AVR_LOG_LEVEL -#define LOG_VERBOSITY CONFIG_FLASH_AVR_LOG_VERBOSITY +// Define log settings for cfg/log.h +#define LOG_LEVEL CONFIG_FLASH_AVR_LOG_LEVEL +#define LOG_FORMAT CONFIG_FLASH_AVR_LOG_FORMAT #include #include @@ -66,7 +66,6 @@ #include - /** * Definition of type for avr flash module. */ @@ -179,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) @@ -250,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).