mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Got uart/usart serial communication working with the atmega168. Added some #define for the appropriate register and interrupt/signal names.
This commit is contained in:
parent
2f97a4b146
commit
896194ff77
@ -30,7 +30,7 @@ UPDATES
|
|||||||
|
|
||||||
0005
|
0005
|
||||||
|
|
||||||
ATmega168 support on the way (currently timers and pwm working).
|
ATmega168 support in the AVR libraries.
|
||||||
New Wiring-compatible randomSeed(), random(max) and random(min, max) functions
|
New Wiring-compatible randomSeed(), random(max) and random(min, max) functions
|
||||||
(except operating on longs instead of floats).
|
(except operating on longs instead of floats).
|
||||||
Fixed bug that sometimes caused uploading of old versions of a sketch.
|
Fixed bug that sometimes caused uploading of old versions of a sketch.
|
||||||
|
@ -58,6 +58,20 @@
|
|||||||
#if defined(UBRR) && !defined(UBRRL)
|
#if defined(UBRR) && !defined(UBRRL)
|
||||||
#define UBRRL UBRR
|
#define UBRRL UBRR
|
||||||
#endif
|
#endif
|
||||||
|
// DAM: it seems the ATmega168 includes a '0' in its register names, despite
|
||||||
|
// having only one uart
|
||||||
|
#if defined(__AVR_ATmega168__)
|
||||||
|
#define RXCIE RXCIE0
|
||||||
|
#define TXCIE TXCIE0
|
||||||
|
#define RXEN RXEN0
|
||||||
|
#define TXEN TXEN0
|
||||||
|
#define UDR UDR0
|
||||||
|
#define UCR UCSR0B
|
||||||
|
#define UBRRL UBRR0L
|
||||||
|
#define UBRRH UBRR0H
|
||||||
|
#define SIG_UART_TRANS USART_TX_vect
|
||||||
|
#define SIG_UART_RECV USART_RX_vect
|
||||||
|
#endif
|
||||||
// compatibility with dual-uart processors
|
// compatibility with dual-uart processors
|
||||||
// (if you need to use both uarts, please use the uart2 library)
|
// (if you need to use both uarts, please use the uart2 library)
|
||||||
#if defined(__AVR_ATmega128__)
|
#if defined(__AVR_ATmega128__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user