Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (379 Bytes)

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

    
4
#define MODE 1
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
        
24
                                spi_send("b", 1);
25
                                delay_ms(1000);
26
                }
27
                
28
        }
29
        
30
        return 0;
31
        
32
}
33