{
for (int i = 0; i < 256; i++)
{
- kprintf("i [%02X], REVERSE(i) [%02X], reverse(i) [%02X]\n", i, REVERSE(i), reverse(i));
- ASSERT(reverse(i) == REVERSE(i));
+ kprintf("i [%02X], REVERSE(i) [%02X], reverse(i) [%02X]\n", i, REVERSE_UINT8(i), reverse(i));
+ ASSERT(reverse(i) == REVERSE_UINT8(i));
}
return 0;
}
* Reverse the bits contained in b (LSB becomes the MSB and so on).
* \note \a b is evaluated twice
*/
-#define REVERSE(b) \
+#define REVERSE_UINT8(b) \
((uint8_t)((((b) * 0x0802UL & 0x22110UL) | ((b) * 0x8020UL & 0x88440UL)) * 0x10101UL >> 16))
#ifndef BV