Project

General

Profile

Revision 546

Added by Kevin Woo over 13 years ago

Modified spi.c/h. Sends 1 packet before failing. Funny light blinking
thing happens when sending, no idea where that came from. It looks like
the orbs are used as transmit lights but there's no code for that as far
as I know.

View differences:

main.c
6 6
extern char spi_status;
7 7

  
8 8
void recv_func(char c) {
9
    if (c != '\n');
9 10
	if(MODE)
10 11
		usb_puts("MASTER");
11 12
	else
12 13
		usb_puts("SLAVE");
14
	
13 15
	usb_puts(": received [");usb_putc(c);usb_puts("]\n\r");
14 16
	return;
15 17
}
......
24 26
	while(1) {
25 27
		if(TEST){
26 28
			if(MODE){
27
				spi_read_one();
29
				spi_read(6);
28 30
				delay_ms(1000);
29 31
			} else {
30
				if(!(spi_status &SPI_SEND))
31
				spi_send("SLAVE",6);
32
				//if(!(spi_status & SPI_SEND))
33
				spi_send("SLAVE ",6);
34
				//delay_ms(800);
32 35
			}
33 36
		} else {
34 37
			if (MODE) {

Also available in: Unified diff