projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refomart.
[bertos.git]
/
bertos
/
cpu
/
avr
/
drv
/
flash_avr.h
diff --git
a/bertos/cpu/avr/drv/flash_avr.h
b/bertos/cpu/avr/drv/flash_avr.h
index db6152a9244d5934b5eff0d5703094082e2d3346..0897132c358809eb3c024c0c9779a739479a7345 100644
(file)
--- a/
bertos/cpu/avr/drv/flash_avr.h
+++ b/
bertos/cpu/avr/drv/flash_avr.h
@@
-42,6
+42,7
@@
#include <cfg/compiler.h>
#include <kern/kfile.h>
#include <cfg/compiler.h>
#include <kern/kfile.h>
+#include <avr/io.h>
/**
/**
@@
-53,24
+54,31
@@
typedef uint16_t avr_page_t;
/**
* FlashAvr KFile context structure.
*/
/**
* FlashAvr KFile context structure.
*/
-typedef struct
KFile
FlashAvr
+typedef struct FlashAvr
{
/**
{
/**
- * File descriptor.
- */
+
* File descriptor.
+
*/
KFile fd;
/**
KFile fd;
/**
- * Current buffered page.
- */
+
* Current buffered page.
+
*/
avr_page_t curr_page;
/**
avr_page_t curr_page;
/**
- * Flag for checking if current page is modified.
- */
+
* Flag for checking if current page is modified.
+
*/
bool page_dirty;
bool page_dirty;
-} KFileFlashAvr;
+ /**
+ * Temporary buffer cointaing data block to
+ * write on flash.
+ */
+ uint8_t page_buf[SPM_PAGESIZE];
+
+
+} FlashAvr;
@@
-80,16
+88,16
@@
typedef struct KFileFlashAvr
#define KFT_FLASHAVR MAKE_ID('F', 'L', 'A', 'V')
/**
#define KFT_FLASHAVR MAKE_ID('F', 'L', 'A', 'V')
/**
- * Convert + ASSERT from generic KFile to
KFile
FlashAvr.
+ * Convert + ASSERT from generic KFile to FlashAvr.
*/
*/
-INLINE
KFileFlashAvr * KFILEFLASHAVR
(KFile *fd)
+INLINE
FlashAvr * FLASHAVR_CAST
(KFile *fd)
{
ASSERT(fd->_type == KFT_FLASHAVR);
{
ASSERT(fd->_type == KFT_FLASHAVR);
- return (
KFile
FlashAvr *)fd;
+ return (FlashAvr *)fd;
}
}
-void flash_avr_init(struct
KFile
FlashAvr *fd);
+void flash_avr_init(struct FlashAvr *fd);