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

Function dump_hex

bsp/ft2004/libraries/bsp/standlone/ft_trace.c:25–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void dump_hex(const u8 *ptr, u32 buflen, const char *tag)
26{
27 unsigned char *buf = (unsigned char *)ptr;
28 u32 i, j;
29
30 Ft_printf("dump hex for %s\r\n", tag);
31 for (i = 0; i < buflen; i += 16)
32 {
33 Ft_printf("%08X: ", ptr + i);
34
35 for (j = 0; j < 16; j++)
36 {
37 if (i + j < buflen)
38 {
39 Ft_printf("%02X ", buf[i + j]);
40 }
41 else
42 {
43 Ft_printf(" ");
44 }
45 }
46 Ft_printf(" ");
47
48 for (j = 0; j < 16; j++)
49 {
50 if (i + j < buflen)
51 {
52 Ft_printf("%c", __is_print(buf[i + j]) ? buf[i + j] : '.');
53 }
54 }
55 Ft_printf("\r\n");
56 }
57}

Callers

nothing calls this directly

Calls 1

Ft_printfFunction · 0.85

Tested by

no test coverage detected