diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-16 02:53:57 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-16 09:58:11 -0800 |
commit | a94748ec6da9bdc6e25a7f73bbea723b8b55fa33 (patch) | |
tree | c6aebc5e8f39d0918f9a88dd43e373ea9d28e210 /src/flash/at91sam7.c | |
parent | f0ce88b3af9a6090ac986160950d66317de5087e (diff) |
rename CEIL as DIV_ROUND_UP
Improves the name of this macro, moves it to types.h, and adds a block
of Doxygen comments to describe what it does.
Diffstat (limited to 'src/flash/at91sam7.c')
-rw-r--r-- | src/flash/at91sam7.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index e0b83d57..9d05d7b5 100644 --- 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; - 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); @@ -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; - 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; |