summaryrefslogtreecommitdiff
path: root/src/jtag/commands.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-16 02:53:57 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-16 09:58:11 -0800
commita94748ec6da9bdc6e25a7f73bbea723b8b55fa33 (patch)
treec6aebc5e8f39d0918f9a88dd43e373ea9d28e210 /src/jtag/commands.c
parentf0ce88b3af9a6090ac986160950d66317de5087e (diff)
downloadopenocd_libswd-a94748ec6da9bdc6e25a7f73bbea723b8b55fa33.tar.gz
openocd_libswd-a94748ec6da9bdc6e25a7f73bbea723b8b55fa33.tar.bz2
openocd_libswd-a94748ec6da9bdc6e25a7f73bbea723b8b55fa33.tar.xz
openocd_libswd-a94748ec6da9bdc6e25a7f73bbea723b8b55fa33.zip
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/jtag/commands.c')
-rw-r--r--src/jtag/commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jtag/commands.c b/src/jtag/commands.c
index ccd6d0f1..4e8ce40f 100644
--- a/src/jtag/commands.c
+++ b/src/jtag/commands.c
@@ -179,7 +179,7 @@ int jtag_build_buffer(const struct scan_command *cmd, uint8_t **buffer)
int i;
bit_count = jtag_scan_size(cmd);
- *buffer = calloc(1,CEIL(bit_count, 8));
+ *buffer = calloc(1,DIV_ROUND_UP(bit_count, 8));
bit_count = 0;
@@ -235,7 +235,7 @@ int jtag_read_buffer(uint8_t *buffer, const struct scan_command *cmd)
if (cmd->fields[i].in_value)
{
int num_bits = cmd->fields[i].num_bits;
- uint8_t *captured = buf_set_buf(buffer, bit_count, malloc(CEIL(num_bits, 8)), 0, num_bits);
+ uint8_t *captured = buf_set_buf(buffer, bit_count, malloc(DIV_ROUND_UP(num_bits, 8)), 0, num_bits);
#ifdef _DEBUG_JTAG_IO_
char *char_buf = buf_to_str(captured,