Refactor code, "page_buf" moved into KFileFlashAvr struct
[bertos.git] / bertos / cpu / avr / drv / flash_avr.h
index 5115d10befde2431238b2b82c6808b5401ce028d..99abf9a1830583397d3b7e8b5b44e2468e058cc8 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <cfg/compiler.h>
 #include <kern/kfile.h>
+#include <avr/io.h>
 
 
 /**
@@ -55,13 +56,27 @@ 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;