log: Retouch documentation; Rearrenge level logic; Rename LOG_VERBOSITY to LOG_FORMAT...
[bertos.git] / bertos / cpu / avr / drv / flash_avr.c
index 8bdd2f91ef7ca4c36ee628b5e9c7b5a21293ca26..daaf4d9b6f72a071eeec902a2283f6609a2d5699 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.
  */
@@ -141,7 +140,7 @@ static void flash_avr_flush(FlashAvr *fd)
  */
 static int flash_avr_kfileFlush(struct KFile *_fd)
 {
-       FlashAvr *fd = FLASHAVRKFILE(_fd);
+       FlashAvr *fd = FLASHAVR_CAST(_fd);
        flash_avr_flush(fd);
        return 0;
 }
@@ -170,7 +169,7 @@ static void flash_avr_loadPage(FlashAvr *fd, avr_page_t page)
  */
 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;
@@ -224,7 +223,7 @@ static void flash_avr_open(struct FlashAvr *fd)
  */
 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;
@@ -235,7 +234,7 @@ static int flash_avr_close(struct KFile *_fd)
  */
 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;
@@ -248,7 +247,7 @@ static struct KFile *flash_avr_reopen(struct KFile *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);