Revision 446
SPI test code update
branches/encoders/code/projects/template/main.c | ||
---|---|---|
1 | 1 |
#include <dragonfly_lib.h> |
2 | 2 |
#include "spi.h" |
3 | 3 |
|
4 |
#define MODE 1
|
|
4 |
#define MODE 0
|
|
5 | 5 |
|
6 | 6 |
void recv_func(char c) { |
7 | 7 |
usb_puts("Received: "); |
... | ... | |
20 | 20 |
while(1) { |
21 | 21 |
//usb_puts("loop\r\n"); |
22 | 22 |
if (MODE) { |
23 |
|
|
24 |
spi_send("b", 1); |
|
25 |
delay_ms(1000); |
|
23 |
spi_master_recv_on(); |
|
24 |
}else { |
|
25 |
SPDR = 'b'; |
|
26 |
// delay_ms(10); |
|
26 | 27 |
} |
27 | 28 |
|
28 | 29 |
} |
branches/encoders/code/projects/template/Makefile | ||
---|---|---|
14 | 14 |
# USE_WIRELESS = 1 |
15 | 15 |
|
16 | 16 |
# com1 = serial port. Use lpt1 to connect to parallel port. |
17 |
AVRDUDE_PORT = com2
|
|
17 |
AVRDUDE_PORT = com3
|
|
18 | 18 |
# |
19 | 19 |
# |
20 | 20 |
################################### |
Also available in: Unified diff