projects
/
fw
/
openocd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename CEIL as DIV_ROUND_UP
[fw/openocd]
/
src
/
flash
/
at91sam7.c
diff --git
a/src/flash/at91sam7.c
b/src/flash/at91sam7.c
index e0b83d5722ea8f56a49267a3d097cb8d8702e983..9d05d7b5847d4b356463d92a386115186c3e19c1 100644
(file)
--- a/
src/flash/at91sam7.c
+++ b/
src/flash/at91sam7.c
@@
-979,7
+979,7
@@
static int at91sam7_write(struct flash_bank *bank, uint8_t *buffer, uint32_t off
return ERROR_FLASH_BANK_NOT_PROBED;
first_page = offset/dst_min_alignment;
return ERROR_FLASH_BANK_NOT_PROBED;
first_page = offset/dst_min_alignment;
- last_page =
CEIL
(offset + count, dst_min_alignment);
+ last_page =
DIV_ROUND_UP
(offset + count, dst_min_alignment);
LOG_DEBUG("first_page: %i, last_page: %i, count %i", (int)first_page, (int)last_page, (int)count);
LOG_DEBUG("first_page: %i, last_page: %i, count %i", (int)first_page, (int)last_page, (int)count);
@@
-997,7
+997,7
@@
static int at91sam7_write(struct flash_bank *bank, uint8_t *buffer, uint32_t off
/* Write one block to the PageWriteBuffer */
buffer_pos = (pagen-first_page)*dst_min_alignment;
/* Write one block to the PageWriteBuffer */
buffer_pos = (pagen-first_page)*dst_min_alignment;
- wcount =
CEIL
(count,4);
+ wcount =
DIV_ROUND_UP
(count,4);
if ((retval = target_write_memory(target, bank->base + pagen*dst_min_alignment, 4, wcount, buffer + buffer_pos)) != ERROR_OK)
{
return retval;
if ((retval = target_write_memory(target, bank->base + pagen*dst_min_alignment, 4, wcount, buffer + buffer_pos)) != ERROR_OK)
{
return retval;