Project

General

Profile

Statistics
| Revision:

root / branches / encoders / code / projects / template / main.c @ 446

History | View | Annotate | Download (404 Bytes)

1
#include <dragonfly_lib.h>
2
#include "spi.h"
3

    
4
#define MODE 0
5

    
6
void recv_func(char c) {
7
        usb_puts("Received: ");
8
        usb_putc(c);
9
        usb_puts("\r\n");
10
        return;
11
}
12

    
13

    
14

    
15
int main(void)
16
{
17
        dragonfly_init(ALL_ON);
18
        spi_init(MODE, recv_func);
19
        usb_puts("Init done\r\n");
20
        while(1) {
21
        //usb_puts("loop\r\n");
22
                if (MODE) {
23
                        spi_master_recv_on();
24
                }else {
25
                        SPDR = 'b';
26
                //        delay_ms(10);
27
                }
28
                
29
        }
30
        
31
        return 0;
32
        
33
}
34