Project

General

Profile

Revision 446

Added by Ben Poole over 14 years ago

SPI test code update

View differences:

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
	}

Also available in: Unified diff