blob: 4d978f785410cf7509f54c5808e3ce779b689d66 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include <avr/io.h>
#include <util/delay.h>
#include <string.h>
#include "../../usart.h"
void rec(uint8_t data) {
if (data)
usart_send(data);
}
int main() {
DDRB |= _BV(DDB1) | _BV(DDB2);
usart_init_uart();
SREG |= _BV(7);
usart_send('a');
usart_send('b');
usart_send('c');
usart_send('d');
usart_send_str("\n\rHello, there is UART echo!\n\r");
usart_receive = rec;
while (1);
}
|