# HG changeset patch # User darius # Date 1132917351 -37800 # Node ID a58b41b7d15c58d0d5e4a76d867ba953a6272392 # Parent 026dc24d85e0e968713388039dcd90a7f89aa43d Covert to a later version of avr-libc. Stuff like not using inb/outb, etc.. diff -r 026dc24d85e0 -r a58b41b7d15c testavr.c --- a/testavr.c Sat Sep 17 18:31:19 2005 +0930 +++ b/testavr.c Fri Nov 25 21:45:51 2005 +1030 @@ -59,15 +59,15 @@ cli(); - outp(0xfc, DDRC); - outp(0x00, PORTC); + DDRC = 0xfc; + PORTC = 0x00; DDRA = 0xff; /* Init UART */ - outp(UART_BAUD_SELECT(UART_BAUD_RATE,XTAL_CPU), UBRR); + UBRR = UART_BAUD_SELECT(UART_BAUD_RATE,XTAL_CPU); /* Enable receiver and transmitter. Turn on transmit interrupts */ - outp(BV(RXEN) | BV(TXEN), UCR); + UCR = _BV(RXEN) | _BV(TXEN); uart_putsP(PSTR("\n\r\n\r===============\n\r" "Inited!\n\r\n\r")); @@ -316,7 +316,7 @@ int uart_putc(char c) { loop_until_bit_is_set(USR, UDRE); - outp(c, UDR); + UDR = c; return(0); } @@ -325,7 +325,7 @@ uart_putsP(const char *addr) { char c; - while ((c = PRG_RDB((unsigned short)addr++))) + while ((c = pgm_read_byte_near(addr++))) uart_putc(c); } @@ -356,9 +356,9 @@ int uart_getc(void) { - while (!(inp(USR) & 0x80)) + while (!USR & 0x80) ; - return (inp(UDR)); + return (UDR); }