Comply to new api.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 1 Sep 2010 11:00:01 +0000 (11:00 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 1 Sep 2010 11:00:01 +0000 (11:00 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4216 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/arm/drv/flash_at91.c
bertos/cpu/avr/drv/flash_avr.c
bertos/cpu/cortex-m3/drv/flash_lm3s.c
bertos/cpu/cortex-m3/drv/flash_stm32.c

index c63dd70702d384ab4ed7745ecfba39860aa56012..adeb558f2f6a823c9f6c2f7916f6d4a9711ef344 100644 (file)
@@ -225,20 +225,21 @@ static void common_init(Flash *fls)
        fls->blk.blk_cnt = FLASH_MEM_SIZE / FLASH_PAGE_SIZE_BYTES;
 }
 
-void flash_hw_init(Flash *fls)
+void flash_hw_init(Flash *fls, int flags)
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_at91_buffered_vt;
-       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE;
+       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE | flags;
        fls->blk.priv.buf = flash_buf;
 
        /* Load the first block in the cache */
        memcpy(fls->blk.priv.buf, (void *)(FLASH_BASE), fls->blk.blk_size);
 }
 
-void flash_hw_initUnbuffered(Flash *fls)
+void flash_hw_initUnbuffered(Flash *fls, int flags)
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_at91_unbuffered_vt;
+       fls->blk.priv.flags |= flags;
 }
 
index 8e7210366e0d12694c68fc185782de9d665fb81d..50e2a6cf6c494fd47377369f0236ab0e546f7862 100644 (file)
@@ -164,18 +164,19 @@ static void common_init(Flash *fls)
 }
 
 
-void flash_hw_init(Flash *fls)
+void flash_hw_init(Flash *fls, int flags)
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_avr_buffered_vt;
-       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE;
+       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE | flags;
        fls->blk.priv.buf = flash_buf;
 }
 
-void flash_hw_initUnbuffered(Flash *fls)
+void flash_hw_initUnbuffered(Flash *fls, int flags)
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_avr_unbuffered_vt;
+       fls->blk.priv.flags |= flags;
 }
 
 
index f2887571949e0ccb03a53a6590991bb6921ba948..7f4e3bb7a9d32ddb4d2db82fcb5646e1c6dc30a5 100644 (file)
@@ -203,11 +203,11 @@ static void common_init(Flash *fls)
 }
 
 
-void flash_hw_init(Flash *fls)
+void flash_hw_init(Flash *fls, int flags);
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_lm3s_buffered_vt;
-       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE;
+       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE | flags;
        fls->blk.priv.buf = flash_buf;
 
        /* Load the first block in the cache */
@@ -215,10 +215,11 @@ void flash_hw_init(Flash *fls)
        memcpy(fls->blk.priv.buf, flash_start, fls->blk.blk_size);
 }
 
-void flash_hw_initUnbuffered(Flash *fls)
+void flash_hw_initUnbuffered(Flash *fls, int flags)
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_lm3s_unbuffered_vt;
+       fls->blk.priv.flags |= flags;
 }
 
 
index 013642affe03031cc5733d11a495eed7512b4124..3b3dd79d2d42047da622ecdb9c4feaa6a87461b1 100644 (file)
@@ -234,11 +234,11 @@ static void common_init(Flash *fls)
 }
 
 
-void flash_hw_init(Flash *fls)
+void flash_hw_init(Flash *fls, int flags)
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_stm32_buffered_vt;
-       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE;
+       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE | flags;
        fls->blk.priv.buf = flash_buf;
 
        /* Load the first block in the cache */
@@ -246,8 +246,9 @@ void flash_hw_init(Flash *fls)
        memcpy(fls->blk.priv.buf, flash_start, fls->blk.blk_size);
 }
 
-void flash_hw_initUnbuffered(Flash *fls)
+void flash_hw_initUnbuffered(Flash *fls, int flags)
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_stm32_unbuffered_vt;
+       fls->blk.priv.flags |= flags;
 }