Little re-indentation
[bertos.git] / bertos / cpu / avr / drv / flash_avr.h
index c64fc699b34019d40d1163be810d999672fa8268..11838ebacf466864e28a29d64231a087ed1c0bde 100644 (file)
 
 #include <cfg/compiler.h>
 #include <kern/kfile.h>
+#include <avr/io.h>
+
+
+/**
+ * Definition of type for avr flash module.
+ */
+typedef uint16_t avr_page_t;
 
 
 /**
  */
 typedef struct KFileFlashAvr
 {
-       KFile fd;                       ///< File descriptor.
+       /**
+        * File descriptor.
+        */
+       KFile fd;
+
+       /**
+        * Current buffered page.
+        */
+       avr_page_t curr_page;
+
+       /**
+        * Flag for checking if current page is modified.
+        */
+       bool page_dirty;
+
+       /**
+        * Temporary buffer cointaing data block to
+        * write on flash.
+        */
+       uint8_t page_buf[SPM_PAGESIZE];
+
+
 } KFileFlashAvr;
 
 
@@ -69,7 +97,7 @@ INLINE KFileFlashAvr * KFILEFLASHAVR(KFile *fd)
 }
 
 
-void flash_avr_init(struct KFile *fd);
+void flash_avr_init(struct KFileFlashAvr *fd);