blob: 5b616b3330fc644cad1dafa185506e6d35205500 (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/*
* example_usage.c
*
*/
#define bit_clr(a,b) ((a) &=~(1<<(b)))
#define bit_set(a,b) ((a) |= (1<<(b)))
#define bit_tst(a,b) ((a) & (1<<(b)))
#define bit_change(a,b) ((a) ^= (1<<(b)))
#include <stdio.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#define Soft_UART_TX_PORT PORTD
#define Soft_UART_TX_DDR DDRD
#define Soft_UART_TX_PIN 3
#define Soft_UART_Baud 9600
#include "Soft_UART_Timer1.h"
#include "r503.h"
static inline void uart_write(const char *s)
{
for (; *s; s++) {
Soft_UART_send_byte(*s);
}
Soft_UART_send_byte('\r');
Soft_UART_send_byte('\n');
}
int main(void)
{
cli();
Soft_UART_init();
bit_set(DDRB,5);
sei();
fpm_init();
if (fpm_clear_db())
fpm_led_on(PURPLE);
while (1)
{
}
return 0;
}
|