From 574d08f7aba9cfec59053ddcb7d2af3ebd0fda64 Mon Sep 17 00:00:00 2001 From: asterix Date: Wed, 1 Sep 2010 11:00:01 +0000 Subject: [PATCH] Comply to new api. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4216 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/arm/drv/flash_at91.c | 7 ++++--- bertos/cpu/avr/drv/flash_avr.c | 7 ++++--- bertos/cpu/cortex-m3/drv/flash_lm3s.c | 7 ++++--- bertos/cpu/cortex-m3/drv/flash_stm32.c | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/bertos/cpu/arm/drv/flash_at91.c b/bertos/cpu/arm/drv/flash_at91.c index c63dd707..adeb558f 100644 --- a/bertos/cpu/arm/drv/flash_at91.c +++ b/bertos/cpu/arm/drv/flash_at91.c @@ -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; } diff --git a/bertos/cpu/avr/drv/flash_avr.c b/bertos/cpu/avr/drv/flash_avr.c index 8e721036..50e2a6cf 100644 --- a/bertos/cpu/avr/drv/flash_avr.c +++ b/bertos/cpu/avr/drv/flash_avr.c @@ -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; } diff --git a/bertos/cpu/cortex-m3/drv/flash_lm3s.c b/bertos/cpu/cortex-m3/drv/flash_lm3s.c index f2887571..7f4e3bb7 100644 --- a/bertos/cpu/cortex-m3/drv/flash_lm3s.c +++ b/bertos/cpu/cortex-m3/drv/flash_lm3s.c @@ -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; } diff --git a/bertos/cpu/cortex-m3/drv/flash_stm32.c b/bertos/cpu/cortex-m3/drv/flash_stm32.c index 013642af..3b3dd79d 100644 --- a/bertos/cpu/cortex-m3/drv/flash_stm32.c +++ b/bertos/cpu/cortex-m3/drv/flash_stm32.c @@ -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; } -- 2.25.1