void usart_printhex(char c) { char lo = c & 0x0F; char hi = (c & 0xF0) >> 4; usart_putchr(hi + ((hi<10)?'0':'A'-10)); usart_putchr(lo + ((lo<10)?'0':'A'-10)); }
void usart_send(const char *s){ RETURN_IF_AVRSIM; while (*s){ if (*s == '\n') usart_putchr('\r'); usart_putchr(*s++); } }
void usart_psend(const char *s){ RETURN_IF_AVRSIM; char c; for (c = pgm_read_byte(s); c; ++s, c = pgm_read_byte(s)){ if (c == '\n') usart_putchr('\r'); usart_putchr(c); } }
void usart_printstr(char *string) { while (*string!='\0') { usart_putchr(*string); string++; } }