5 #include <avr/pgmspace.h>
7 /*-----------------------------------------------------------------------------------*/
12 for(i
= 0; i
< 1; ++i
) {
16 /*-----------------------------------------------------------------------------------*/
17 static char buffer
[40];
18 static prog_char hextab
[] =
19 {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
20 /*-----------------------------------------------------------------------------------*/
22 print_buffer(unsigned char len
)
26 for(i
= 0; i
< len
; ++i
) {
31 /*-----------------------------------------------------------------------------------*/
33 debug_print8(unsigned char v
)
35 /* buffer[0] = v / 100 + '0';
36 buffer[1] = (v / 10) % 10 + '0';
37 buffer[2] = v % 10 + '0';
39 buffer[4] = PRG_RDB(hextab + (v >> 4));
40 buffer[5] = PRG_RDB(hextab + (v & 0x0f));
44 /*-----------------------------------------------------------------------------------*/
46 debug_print16(unsigned short v
)
48 /* buffer[0] = v / 10000 + '0';
49 buffer[1] = (v / 1000) % 10 + '0';
50 buffer[2] = (v / 100) % 10 + '0';
51 buffer[3] = (v / 10) % 10 + '0';
52 buffer[4] = v % 10 + '0';
54 buffer[6] = PRG_RDB(hextab + ((v & 0xf000) >> 12));
55 buffer[7] = PRG_RDB(hextab + ((v & 0x0f00) >> 8));
56 buffer[8] = PRG_RDB(hextab + ((v & 0xf0) >> 4));
57 buffer[9] = PRG_RDB(hextab + (v & 0x0f));
61 /*-----------------------------------------------------------------------------------*/
63 debug_print(prog_char
*str
)
67 for(i = 0; PRG_RDB(str + i) != 0; ++i) {
68 buffer[i] = PRG_RDB(str + i);
72 /*-----------------------------------------------------------------------------------*/