Merge branch "preempt" in "trunk".
[bertos.git] / bertos / cpu / avr / drv / flash_avr.c
index 413cac80b5f5063da9998ede9445f55a70ee4096..03740dd7c5c121a506fac670e9048103124a698d 100644 (file)
@@ -50,9 +50,9 @@
 #include <cfg/debug.h>
 #include <cpu/irq.h>
 
-       // 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 <cfg/log.h>
 
 #include <drv/wdt.h>
@@ -66,7 +66,6 @@
 #include <string.h>
 
 
-
 /**
  * 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).