projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sam3: add register definitions for RSTC and EMAC
[bertos.git]
/
bertos
/
cpu
/
cortex-m3
/
drv
/
flash_stm32.c
diff --git
a/bertos/cpu/cortex-m3/drv/flash_stm32.c
b/bertos/cpu/cortex-m3/drv/flash_stm32.c
index 62e448f3ab35dd9d201ba78756c89b3655247d9f..d92e91420cbb67bd5ce3171e76679c03d11ac305 100644
(file)
--- a/
bertos/cpu/cortex-m3/drv/flash_stm32.c
+++ b/
bertos/cpu/cortex-m3/drv/flash_stm32.c
@@
-67,6
+67,7
@@
static bool flash_wait(struct KBlock *blk)
ticks_t start = timer_clock();
while (true)
{
ticks_t start = timer_clock();
while (true)
{
+ cpu_relax();
if (!(EMB_FLASH->SR & FLASH_FLAG_BSY))
break;
if (!(EMB_FLASH->SR & FLASH_FLAG_BSY))
break;
@@
-90,8
+91,6
@@
static bool flash_wait(struct KBlock *blk)
LOG_ERR("Timeout..\n");
return false;
}
LOG_ERR("Timeout..\n");
return false;
}
-
- cpu_relax();
}
return true;
}
return true;
@@
-112,6
+111,8
@@
static bool stm32_erasePage(struct KBlock *blk, uint32_t page_add)
return true;
}
return true;
}
+#if 0
+// not used for now
static bool stm32_eraseAll(struct KBlock *blk)
{
EMB_FLASH->CR |= CR_MER_SET;
static bool stm32_eraseAll(struct KBlock *blk)
{
EMB_FLASH->CR |= CR_MER_SET;
@@
-124,6
+125,7
@@
static bool stm32_eraseAll(struct KBlock *blk)
return true;
}
return true;
}
+#endif
static int stm32_flash_error(struct KBlock *blk)
{
static int stm32_flash_error(struct KBlock *blk)
{
@@
-231,11
+233,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;
{
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 */
fls->blk.priv.buf = flash_buf;
/* Load the first block in the cache */
@@
-243,9
+245,8
@@
void flash_hw_init(Flash *fls, int flags)
memcpy(fls->blk.priv.buf, flash_start, fls->blk.blk_size);
}
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;
{
common_init(fls);
fls->blk.priv.vt = &flash_stm32_unbuffered_vt;
- fls->blk.priv.flags |= flags;
}
}