Changeset 6c47e45 in avrstuff
- Timestamp:
- Sep 24, 2017, 7:47:43 PM (7 years ago)
- Branches:
- main
- Children:
- c0a8b2a
- Parents:
- 6390cc3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libs/usart/usart.c
r6390cc3 r6c47e45 40 40 UCSRC = (1 << UCSZ1) | (1 << UCSZ0); 41 41 #elif defined __AVR_ATmega128__ 42 UCSRC = (3 << UCSZ0); 42 UCSR0C = (2 << UCSZ0) | (2 << UPM0) ; /* 7 bits + even parity. 43 TODO make this configurable. */ 43 44 #else 44 45 UCSRC = (1 << URSEL) | (3 << UCSZ0); … … 55 56 { 56 57 //Wait untill the transmitter is ready 57 while(!(UCSR A & (1<<UDRE)))58 while(!(UCSR0A & (1<<UDRE0))) 58 59 { 59 60 //Do nothing … … 72 73 { 73 74 //Wait untill a data is available 74 while(!(UCSR A & (1<<RXC)))75 while(!(UCSR0A & (1<<RXC0))) 75 76 { 76 77 //Do nothing … … 80 81 //and is available is buffer 81 82 82 return UDR ;83 return UDR0; 83 84 } 84 85
Note:
See TracChangeset
for help on using the changeset viewer.