Changeset e5dd493 in avrstuff for libs/usart/usart.c


Ignore:
Timestamp:
Sep 8, 2019, 9:09:42 AM (5 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
c956fd4
Parents:
6f22754
Message:

usart: some cleanups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libs/usart/usart.c

    r6f22754 re5dd493  
    88#endif
    99
    10 #ifdef __AVR_ATmega128__
    1110// FIXME there are two USARTs in this case and we should be able to drive either
    12 #define UBRRH UBRR0H
    13 #define UBRRL UBRR0L
    14 #define UCSRA UCSR0A
    15 #define UCSRC UCSR0C
    16 #define UCSRB UCSR0B
    17 #define UDR   UDR0
     11
     12// Compatibility for devices with single USART only
     13#ifdef __AVR_ATmega8__
     14#define UBRR0H UBRRH
     15#define UBRR0L UBRRL
     16#define UCSR0A UCSRA
     17#define UCSR0C UCSRC
     18#define UCSR0B UCSRB
     19#define UDR0   UDR
     20#define UDRE0  UDRE
     21#define RXC0   RXC
    1822#endif
    1923
    20 //This function is used to initialize the USART
    2124void USARTInit()
    2225{
     
    5154
    5255
    53 //This fuction writes the given "data" to
    54 //the USART which then transmit it via TX line
    5556void USARTWriteChar(char data)
    5657{
     
    6768
    6869
    69 //This function is used to read the available data
    70 //from USART. This function will wait untill data is
    71 //available.
    7270char USARTReadChar()
    7371{
Note: See TracChangeset for help on using the changeset viewer.