-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.c
More file actions
37 lines (33 loc) · 775 Bytes
/
debug.c
File metadata and controls
37 lines (33 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* debug.c
*
* $Id: debug.c,v 1.1 2006/02/13 09:58:08 andrzej Exp $
*
* Redboot Flash Configuration parser.
* Debug utilities.
*
* Copyright (C) 2006 Ekiert sp z o.o.
* Author: Andrzej Ekiert <a.ekiert@ekiert.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <stdio.h>
#include "debug.h"
uint8_t verbosity = VERB_LOW;
void hex_dump(void *buf, uint16_t len)
{
uint16_t i;
for (i = 0 ; i < len; i++) {
printf("%02x", ((uint8_t*)buf)[i]);
if (i%2) {
printf(" ");
}
if (15 == i%16) {
printf("\n");
}
}
printf("\n");
}