]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/uart.c
forgot hfal_shabval.*
[avr-crypto-lib.git] / test_src / uart.c
index 06b3cec0db0e2f2a7581657e10a4a93bd999a35c..56b22dd7fd29c65009bb36a923115767cc3588c9 100644 (file)
@@ -23,7 +23,7 @@
 #include <avr/io.h>
 #include <avr/interrupt.h>
 #include <stdlib.h>
-
+#include "hexdigit_tab.h"
 #include "uart.h"
 
 #ifdef ATMEGA128
@@ -81,6 +81,9 @@
 
 
 #ifdef UART_XON_XOFF
+#define XON  0x11
+#define XOFF 0x13
+
  #ifdef UART_INTERRUPT
   void uart_insertc(char c);
  #else
@@ -279,11 +282,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;
        }