X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fuart.c;h=0c9943c914340aa8b715c4daf274443b88a67703;hb=74fe0d1999c8dee4babb971174648da906886874;hp=06b3cec0db0e2f2a7581657e10a4a93bd999a35c;hpb=5fe96fa58fee8907778ba3388b65d779a1a47c97;p=avr-crypto-lib.git diff --git a/test_src/uart.c b/test_src/uart.c index 06b3cec..0c9943c 100644 --- a/test_src/uart.c +++ b/test_src/uart.c @@ -23,7 +23,7 @@ #include #include #include - +#include "hexdigit_tab.h" #include "uart.h" #ifdef ATMEGA128 @@ -279,11 +279,9 @@ void uart_putstr_P(PGM_P str) { void uart_hexdump(const void* buf, int len) { - unsigned char table[]={'0','1','2','3','4','5','6','7', - '8','9','a','b','c','d','e','f'}; while(len--){ - uart_putc(table[((*((char*)buf))>>4)&0xf]); - uart_putc(table[(*((char*)buf))&0xf]); + uart_putc(pgm_read_byte(hexdigit_tab_P + ((*((uint8_t*)buf))>>4))); + uart_putc(pgm_read_byte(hexdigit_tab_P + ((*((uint8_t*)buf))&0xf))); uart_putc(' '); buf=(uint8_t*)buf+1; }