Move flash related flags to the flash driver; refactor accordingly.
[bertos.git] / bertos / cpu / cortex-m3 / drv / flash_stm32.c
index 62e448f3ab35dd9d201ba78756c89b3655247d9f..816cdd58f94096f459a240f6a18f386cdc665328 100644 (file)
@@ -112,6 +112,8 @@ static bool stm32_erasePage(struct KBlock *blk, uint32_t page_add)
        return true;
 }
 
+#if 0
+// not used for now
 static bool stm32_eraseAll(struct KBlock *blk)
 {
        EMB_FLASH->CR |= CR_MER_SET;
@@ -124,6 +126,7 @@ static bool stm32_eraseAll(struct KBlock *blk)
 
        return true;
 }
+#endif
 
 static int stm32_flash_error(struct KBlock *blk)
 {
@@ -231,11 +234,11 @@ static void common_init(Flash *fls)
 }
 
 
-void flash_hw_init(Flash *fls, int flags)
+void flash_hw_init(Flash *fls, UNUSED_ARG(int, flags))
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_stm32_buffered_vt;
-       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE | flags;
+       fls->blk.priv.flags |= KB_BUFFERED | KB_PARTIAL_WRITE;
        fls->blk.priv.buf = flash_buf;
 
        /* Load the first block in the cache */
@@ -243,9 +246,8 @@ void flash_hw_init(Flash *fls, int flags)
        memcpy(fls->blk.priv.buf, flash_start, fls->blk.blk_size);
 }
 
-void flash_hw_initUnbuffered(Flash *fls, int flags)
+void flash_hw_initUnbuffered(Flash *fls, UNUSED_ARG(int, flags))
 {
        common_init(fls);
        fls->blk.priv.vt = &flash_stm32_unbuffered_vt;
-       fls->blk.priv.flags |= flags;
 }