MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / Ft_DumpHexByte

Function Ft_DumpHexByte

bsp/ft2004/libraries/bsp/standlone/ft_debug.c:16–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15#define __is_print(ch) ((unsigned int)((ch) - ' ') < 127u - ' ')
16void Ft_DumpHexByte(const u8 *ptr, ft_base_t buflen)
17{
18 unsigned char *buf = (unsigned char *)ptr;
19 int i, j;
20
21 for (i = 0; i < buflen; i += 16)
22 {
23 Ft_printf("0x%08X: ", ptr + i);
24
25 for (j = 0; j < 16; j++)
26 if (i + j < buflen)
27 Ft_printf("%02X ", buf[i + j]);
28 else
29 Ft_printf(" ");
30 Ft_printf(" ");
31
32 for (j = 0; j < 16; j++)
33 if (i + j < buflen)
34 Ft_printf("%c", __is_print(buf[i + j]) ? buf[i + j] : '.');
35 Ft_printf("\r\n");
36 }
37}
38
39void Ft_DumpHexWord(const u32 *ptr, ft_base_t buflen)
40{

Callers

nothing calls this directly

Calls 1

Ft_printfFunction · 0.85

Tested by

no test coverage detected