On 24/04/2009, Zach Welch <z...@superlucidity.net> wrote:
> Hi all,
>
>  The attached patch adds a literate macro for the calculation of the
>  number of bytes required to store a TAP scan chain given its bit count.
>
>  This macro ensures this calculation will be done correctly in all
>  locations that it is required, though this patch simply changes the line
>  of code in the J-Link driver that originated the macro.  Would someone
>  like to chase down all of the other references and submit another patch?
>
>  While other parts of the tree are likely to find a use for it, but it
>  will be required for the next patch.  Please apply.

>From your patch:
+/// @brief calculates number of bytes required to hold @a n TAP scan bits
+#define TAP_SCAN_BYTES(n)              (((n) / 8) + !!((n) % 8))

Are you aware that in src/helper/binarybuffer.h there's a similar
macro? This is used in to FT2232 driver and other places already:

#define CEIL(m, n)      ((m + n - 1) / n)
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to